++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/kernel/at_wini.c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 10100 /* This file contains the device dependent part of a driver for the IBM-AT 10101 * winchester controller. 10102 * It was written by Adri Koppes. 10103 * 10104 * The file contains one entry point: 10105 * 10106 * at_winchester_task: main entry when system is brought up 10111 */ 10273 /* Entry points to this driver. */ 10274 PRIVATE struct driver w_dtab = { 10275 w_name, /* current device's name */ 10276 w_do_open, /* open or mount request, initialize device */ 10277 w_do_close, /* release device */ 10278 do_diocntl, /* get or set a partition's geometry */ 10279 w_prepare, /* prepare for I/O on a given minor device */ 10280 w_schedule, /* precompute cylinder, head, sector, etc. */ 10281 w_finish, /* do the I/O */ 10282 nop_cleanup, /* nothing to clean up */ 10283 w_geometry, /* tell the geometry of the disk */ 10284 }; 10291 /*===========================================================================* 10292 * at_winchester_task * 10293 *===========================================================================*/ 10294 PUBLIC void at_winchester_task() 10295 { 10296 /* Set special disk parameters then call the generic main loop. */ 10297 10298 init_params(); 10299 10300 driver_task(&w_dtab); 10301 } 10412 /*===========================================================================* 10413 * w_identify * 10414 *===========================================================================*/ 10415 PRIVATE int w_identify() 10416 { 10417 /* Find out if a device exists, if it is an old AT disk, or a newer ATA 10418 * drive, a removable media device, etc. 10419 */ 10439 /* Looks OK; register IRQ and try an ATA identify command. */ 10440 put_irq_handler(wn->irq, w_handler); 10441 enable_irq(wn->irq); 10504 return(OK); 10505 } 10973 /*==========================================================================* 10974 * w_handler * 10975 *==========================================================================*/ 10976 PRIVATE int w_handler(irq) 10977 int irq; 10978 { 10979 /* Disk interrupt, send message to winchester task and reenable interrupts. */ 10980 10981 w_status = in_byte(w_wn->base + REG_STATUS); /* acknowledge interrupt */ 10982 interrupt(WINCHESTER); 10983 return 1; 10984 }