Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion 8018x.config
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ CONFIG_EXEC_MMODEL=y
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_DEV_BHD is not set
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_DEV_HD is not set
# CONFIG_TRACK_CACHE is not set
# CONFIG_IDE_PROBE is not set
# CONFIG_BLK_DEV_RAM is not set
Expand Down
1 change: 0 additions & 1 deletion blink16.config
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ CONFIG_BLK_DEV_BFD=y
CONFIG_BLK_DEV_BHD=y
CONFIG_IDE_PROBE=y
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_DEV_HD is not set
# CONFIG_BLK_DEV_RAM is not set
CONFIG_RAMDISK_SEGMENT=0xD000
CONFIG_RAMDISK_SECTORS=128
Expand Down
1 change: 0 additions & 1 deletion elks/arch/i86/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ CONFIG_TRACK_CACHE=y
CONFIG_BLK_DEV_BHD=y
CONFIG_IDE_PROBE=y
CONFIG_BLK_DEV_FD=y
# CONFIG_BLK_DEV_HD is not set

#
# Additional block devices
Expand Down
66 changes: 21 additions & 45 deletions elks/arch/i86/drivers/block/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,71 +33,47 @@ include $(BASEDIR)/Makefile-rules
#########################################################################
# Objects to be compiled.

OBJS = init.o genhd.o ll_rw_blk.o

# BIOS floppy and/or hard drive support
ifeq ($(CONFIG_BLK_DEV_BFD), y)
OBJS += bioshd.o bios.o
endif

ifeq ($(CONFIG_BLK_DEV_BHD), y)
ifneq ($(CONFIG_BLK_DEV_BFD), y)
OBJS += bioshd.o bios.o
endif
ifeq ($(CONFIG_IDE_PROBE), y)
OBJS += idequery.o
endif
endif

# direct fd support
ifeq ($(CONFIG_BLK_DEV_FD), y)
OBJS += directfd.o
endif

ifeq ($(CONFIG_BLK_DEV_RAM), y)
OBJS += rd.o
OBJS = init.o ll_rw_blk.o genhd.o hdinfo.o
OBJS += bioshd.o bios.o # CONFIG_BLK_DEV_BFD / CONFIG_BLK_DEV_BHD
OBJS += ata.o ata-cf.o # CONFIG_BLK_DEV_ATA_CF
OBJS += rd.o # CONFIG_BLK_DEV_RAM
OBJS += idequery.o # CONFIG_IDE_PROBE
OBJS += romflash.o # CONFIG_ROMFS_FS

ifdef CONFIG_ASYNCIO
OBJS += directfd.o # CONFIG_BLK_DEV_FD
endif

ifeq ($(CONFIG_ROMFS_FS), y)
OBJS += romflash.o
ifdef CONFIG_ARCH_IBMPC
OBJS += mfmhd.o # CONFIG_BLK_DEV_MFMHD
endif

ifeq ($(CONFIG_FS_XMS), y)
ifeq ($(CONFIG_FS_XMS_RAMDISK), y)
#
# SSD driver
#
ifdef CONFIG_FS_XMS
ifdef CONFIG_FS_XMS_RAMDISK
OBJS += ssd.o ssd-xms.o
endif
endif

ifeq ($(CONFIG_BLK_DEV_SSD_TEST), y)
ifdef CONFIG_BLK_DEV_SSD_TEST
OBJS += ssd.o ssd-test.o
endif

ifeq ($(CONFIG_BLK_DEV_SSD_SD), y)
ifeq ($(CONFIG_ARCH_NECV25), y)
ifeq ($(CONFIG_HW_SPI), y)
ifdef CONFIG_BLK_DEV_SSD_SD
ifdef CONFIG_ARCH_NECV25
ifdef CONFIG_HW_SPI
OBJS += ssd.o ssd-sd.o spi-hw-necv25.o
else
OBJS += ssd.o ssd-sd.o spi-necv25.o
endif
endif
ifeq ($(CONFIG_ARCH_8018X), y)
ifdef CONFIG_ARCH_8018X
OBJS += ssd.o ssd-sd.o spi-8018x.o
endif
endif

ifeq ($(CONFIG_BLK_DEV_ATA_CF), y)
OBJS += ata.o ata-cf.o
endif

ifeq ($(CONFIG_BLK_DEV_MFMHD), y)
OBJS += mfmhd.o
endif

# experimental (and not working) direct hd support
ifeq ($(CONFIG_BLK_DEV_HD), y)
OBJS += directhd.o
endif

#########################################################################
# Commands.

Expand Down
63 changes: 0 additions & 63 deletions elks/arch/i86/drivers/block/genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
#include <arch/system.h>
#include "blk.h"

#if defined(CONFIG_BLK_DEV_BHD) || defined(CONFIG_BLK_DEV_ATA_CF) || \
defined(CONFIG_BLK_DEV_MFMHD)

#define NR_SECTS(p) p->nr_sects
#define START_SECT(p) p->start_sect

Expand Down Expand Up @@ -363,63 +360,3 @@ void GENPROC init_partitions(struct gendisk *hd)
check_partition(hd, MKDEV(hd->major, first_minor));
}
}
#endif /* CONFIG_BLK_DEV_BHD || CONFIG_BLK_DEV_ATA_CF || CONFIG_BLK_DEV_MFMHD */

#if defined(CONFIG_BLK_DEV_BFD) || defined(CONFIG_BLK_DEV_BHD) || \
defined(CONFIG_BLK_DEV_ATA_CF) || defined(CONFIG_BLK_DEV_MFMHD)

int ioctl_hdio_geometry(struct gendisk *hd, kdev_t dev, struct hd_geometry *loc)
{
unsigned short minor = MINOR(dev);
int drive = minor >> hd->minor_shift;
struct drive_infot *drivep;
int err;

drivep = &hd->drive_info[drive];
err = verify_area(VERIFY_WRITE, (void *)loc, sizeof(struct hd_geometry));
if (!err) {
put_user_char(drivep->heads, &loc->heads);
put_user_char(drivep->sectors, &loc->sectors);
put_user(drivep->cylinders, &loc->cylinders);
put_user_long(hd->part[minor].start_sect, &loc->start);
}
return err;
}

void GENPROC show_drive_info(struct drive_infot *drivep, const char *name, int drive,
int count, const char *eol)
{
unsigned long size;
char *unit;
static char UNITS[4] = "KMGT";

for (; count; count--, drive++) {
if (drivep->cylinders != 0) {
unit = UNITS;
size = (unsigned long)drivep->sectors * 5; /* 0.1 kB units */
if (drivep->sector_size == 1024)
size <<= 1;
size *= ((unsigned long) drivep->cylinders) * drivep->heads;

/* Select appropriate unit */
while (size > 99999 && unit[1]) {
debug("DBG: Size = %lu (%X/%X)\n", size, *unit, unit[1]);
size += 512;
size /= 1024U;
unit++;
}
debug("DBG: Size = %lu (%X/%X)\n",size,*unit,unit[1]);
printk("%s%c: %4lu%c CHS %3u,%2d,%d",
name, drive + (drivep->fdtype < 0? 'a' : '0'), (size/10), *unit,
drivep->cylinders, drivep->heads, drivep->sectors);
#ifdef CONFIG_ARCH_IBMPC
/* IBM BIOS INT 13 can't use HD drives > 528MB, must use ATA/CF driver */
if (drivep->cylinders > 1024 && name[0] == 'h')
printk(" (CYL > 1024, must use /dev/cf%c)", drive+'a');
#endif
printk("%s", eol);
}
drivep++;
}
}
#endif
59 changes: 59 additions & 0 deletions elks/arch/i86/drivers/block/hdinfo.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#include <linuxmt/config.h>
#include <linuxmt/genhd.h>
#include <linuxmt/mm.h>
#include <linuxmt/debug.h>

int ioctl_hdio_geometry(struct gendisk *hd, kdev_t dev, struct hd_geometry *loc)
{
unsigned short minor = MINOR(dev);
int drive = minor >> hd->minor_shift;
struct drive_infot *drivep;
int err;

drivep = &hd->drive_info[drive];
err = verify_area(VERIFY_WRITE, (void *)loc, sizeof(struct hd_geometry));
if (!err) {
put_user_char(drivep->heads, &loc->heads);
put_user_char(drivep->sectors, &loc->sectors);
put_user(drivep->cylinders, &loc->cylinders);
put_user_long(hd->part[minor].start_sect, &loc->start);
}
return err;
}

void GENPROC show_drive_info(struct drive_infot *drivep, const char *name, int drive,
int count, const char *eol)
{
unsigned long size;
char *unit;
static char UNITS[4] = "KMGT";

for (; count; count--, drive++) {
if (drivep->cylinders != 0) {
unit = UNITS;
size = (unsigned long)drivep->sectors * 5; /* 0.1 kB units */
if (drivep->sector_size == 1024)
size <<= 1;
size *= ((unsigned long) drivep->cylinders) * drivep->heads;

/* Select appropriate unit */
while (size > 99999 && unit[1]) {
debug("DBG: Size = %lu (%X/%X)\n", size, *unit, unit[1]);
size += 512;
size /= 1024U;
unit++;
}
debug("DBG: Size = %lu (%X/%X)\n",size,*unit,unit[1]);
printk("%s%c: %4lu%c CHS %3u,%2d,%d",
name, drive + (drivep->fdtype < 0? 'a' : '0'), (size/10), *unit,
drivep->cylinders, drivep->heads, drivep->sectors);
#ifdef CONFIG_ARCH_IBMPC
/* IBM BIOS INT 13 can't use HD drives > 528MB, must use ATA/CF driver */
if (drivep->cylinders > 1024 && name[0] == 'h')
printk(" (CYL > 1024, must use /dev/cf%c)", drive+'a');
#endif
printk("%s", eol);
}
drivep++;
}
}
4 changes: 0 additions & 4 deletions elks/arch/i86/drivers/block/ll_rw_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,6 @@ void INITPROC blk_dev_init(void)
rd_init(); /* RAMDISK block device*/
#endif

#ifdef CONFIG_BLK_DEV_HD
struct gendisk *hddisk = directhd_init();
#endif

#ifdef CONFIG_BLK_DEV_MFMHD
struct gendisk *mfmdisk = mfmhd_init();
#endif
Expand Down
6 changes: 3 additions & 3 deletions elks/arch/i86/drivers/block/mfmhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2320,14 +2320,14 @@ void mfmhd_park_all(void)
* each with an actuator of its own, so park the pair.
*/
if (drive == 0 && drive_info[drive].source == MFM_GEO_SRC_FILECARD20) {
mfmhd_seek_unit(MFMHD_PORT, drive, 0,
mfmhd_seek_unit(mfm_port, drive, 0,
MFM_FILECARD20_UNIT_CYLINDERS - 1);
mfmhd_seek_unit(MFMHD_PORT, drive, 1,
mfmhd_seek_unit(mfm_port, drive, 1,
MFM_FILECARD20_UNIT_CYLINDERS - 1);
continue;
}

mfmhd_seek_unit(MFMHD_PORT, drive, (unsigned int)drive & 1U,
mfmhd_seek_unit(mfm_port, drive, (unsigned int)drive & 1U,
drive_info[drive].cylinders - 1); /* cylinders are zero based */
}
}
Expand Down
Loading
Loading