Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kernel] Add @Mellvik's direct floppy driver #1716

Merged
merged 2 commits into from
Sep 13, 2023
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 elks/arch/i86/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ CONFIG_BLK_DEV_BHD=y
CONFIG_IDE_PROBE=y
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_DEV_HD is not set
# CONFIG_DMA is not set

#
# Additional block devices
Expand Down
9 changes: 5 additions & 4 deletions elks/arch/i86/drivers/block/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,15 @@ ifeq ($(CONFIG_BLK_DEV_SSD_SD8018X), y)
OBJS += ssd.o ssd-sd.o spi-8018x.o
endif

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

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

#########################################################################
# Commands.
Expand Down
7 changes: 4 additions & 3 deletions elks/arch/i86/drivers/block/blk.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ struct request {
ramdesc_t rq_seg; /* L1 or L2 ext/xms buffer segment */
struct buffer_head *rq_bh; /* system buffer head for notifications and locking */
struct request *rq_next; /* next request, used when async I/O */
int rq_errors; /* only used by direct floppy driver */
};

#define RQ_INACTIVE 0
Expand Down Expand Up @@ -74,10 +75,10 @@ extern void resetup_one_dev(struct gendisk *dev, int drive);

#ifdef FLOPPYDISK

static void floppy_on(unsigned int nr);
static void floppy_on(int nr);
static void floppy_off(unsigned int nr);

#define DEVICE_NAME "fd"
#define DEVICE_NAME "df"
#define DEVICE_INTR do_floppy
#define DEVICE_REQUEST do_fd_request
#define DEVICE_NR(device) ((device) & 3)
Expand Down Expand Up @@ -146,7 +147,7 @@ static void end_request(int uptodate)
mark_buffer_uptodate(bh, uptodate);
unlock_buffer(bh);

DEVICE_OFF(req->dev);
DEVICE_OFF(req->rq_dev);
CURRENT = req->rq_next;
req->rq_status = RQ_INACTIVE;

Expand Down
8 changes: 2 additions & 6 deletions elks/arch/i86/drivers/block/config.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,9 @@ mainmenu_option next_comment
bool ' IDE hard drive CHS probe' CONFIG_IDE_PROBE y
fi

if [ "$CONFIG_BLK_DEV_FD" = "y" ]; then
define_bool CONFIG_DMA y
else
define_bool CONFIG_DMA n
fi

comment 'Additional block devices'
bool 'Direct floppy driver (experimental)' CONFIG_BLK_DEV_FD n

bool 'RAM disk support' CONFIG_BLK_DEV_RAM y
if [ "$CONFIG_BLK_DEV_RAM" == "y" ]; then
hex 'Preload RAM disk segment address' CONFIG_RAMDISK_SEGMENT 0
Expand Down
Loading