5 /**************************************************************************
6 DISK_INIT - Initialize the disk system
7 **************************************************************************/
8 void disk_init ( void ) {
9 REAL_EXEC ( rm_disk_init,
18 CLOBBER ( "eax", "ebx", "ecx", "edx",
19 "ebp", "esi", "edi" ) );
22 /**************************************************************************
23 DISK_READ - Read a sector from disk
24 **************************************************************************/
25 unsigned int pcbios_disk_read ( int drive, int cylinder, int head, int sector,
27 uint16_t ax, flags, discard_c, discard_d;
28 segoff_t buf = SEGOFF ( fixme_buf );
30 /* FIXME: buf should be passed in as a segoff_t rather than a
34 REAL_EXEC ( rm_pcbios_disk_read,
36 "pushl %%ebx\n\t" /* Convert %ebx to %es:bx */
39 "movb $0x02, %%ah\n\t" /* INT 13,2 - Read disk sector */
40 "movb $0x01, %%al\n\t" /* Read one sector */
46 OUT_CONSTRAINTS ( "=a" ( ax ), "=b" ( flags ),
47 "=c" ( discard_c ), "=d" ( discard_d ) ),
48 IN_CONSTRAINTS ( "c" ( ( ( cylinder & 0xff ) << 8 ) |
49 ( ( cylinder >> 8 ) & 0x3 ) |
51 "d" ( ( head << 8 ) | drive ),
53 CLOBBER ( "ebp", "esi", "edi" ) );
55 return ( flags & CF ) ? ax : 0;