|
@@ -64,59 +64,3 @@ void cpu_nap ( void ) {
|
64
|
64
|
IN_CONSTRAINTS (),
|
65
|
65
|
CLOBBER ( "eax" ) ); /* can't have an empty clobber list */
|
66
|
66
|
}
|
67
|
|
-
|
68
|
|
-#if (TRY_FLOPPY_FIRST > 0)
|
69
|
|
-/**************************************************************************
|
70
|
|
-DISK_INIT - Initialize the disk system
|
71
|
|
-**************************************************************************/
|
72
|
|
-void disk_init ( void ) {
|
73
|
|
- REAL_EXEC ( rm_disk_init,
|
74
|
|
- "sti\n\t"
|
75
|
|
- "xorw %ax,%ax\n\t"
|
76
|
|
- "movb $0x80,%dl\n\t"
|
77
|
|
- "int $0x13\n\t"
|
78
|
|
- "cli\n\t",
|
79
|
|
- 0,
|
80
|
|
- OUT_CONSTRAINTS (),
|
81
|
|
- IN_CONSTRAINTS (),
|
82
|
|
- CLOBBER ( "eax", "ebx", "ecx", "edx",
|
83
|
|
- "ebp", "esi", "edi" ) );
|
84
|
|
-}
|
85
|
|
-
|
86
|
|
-/**************************************************************************
|
87
|
|
-DISK_READ - Read a sector from disk
|
88
|
|
-**************************************************************************/
|
89
|
|
-unsigned int pcbios_disk_read ( int drive, int cylinder, int head, int sector,
|
90
|
|
- char *fixme_buf ) {
|
91
|
|
- uint16_t ax, flags, discard_c, discard_d;
|
92
|
|
- segoff_t buf = SEGOFF ( fixme_buf );
|
93
|
|
-
|
94
|
|
- /* FIXME: buf should be passed in as a segoff_t rather than a
|
95
|
|
- * char *
|
96
|
|
- */
|
97
|
|
-
|
98
|
|
- REAL_EXEC ( rm_pcbios_disk_read,
|
99
|
|
- "sti\n\t"
|
100
|
|
- "pushl %%ebx\n\t" /* Convert %ebx to %es:bx */
|
101
|
|
- "popl %%bx\n\t"
|
102
|
|
- "popl %%es\n\t"
|
103
|
|
- "movb $0x02, %%ah\n\t" /* INT 13,2 - Read disk sector */
|
104
|
|
- "movb $0x01, %%al\n\t" /* Read one sector */
|
105
|
|
- "int $0x13\n\t"
|
106
|
|
- "pushfw\n\t"
|
107
|
|
- "popw %%bx\n\t"
|
108
|
|
- "cli\n\t",
|
109
|
|
- 4,
|
110
|
|
- OUT_CONSTRAINTS ( "=a" ( ax ), "=b" ( flags ),
|
111
|
|
- "=c" ( discard_c ), "=d" ( discard_d ) ),
|
112
|
|
- IN_CONSTRAINTS ( "c" ( ( ( cylinder & 0xff ) << 8 ) |
|
113
|
|
- ( ( cylinder >> 8 ) & 0x3 ) |
|
114
|
|
- sector ),
|
115
|
|
- "d" ( ( head << 8 ) | drive ),
|
116
|
|
- "b" ( buf ) ),
|
117
|
|
- CLOBBER ( "ebp", "esi", "edi" ) );
|
118
|
|
- );
|
119
|
|
-
|
120
|
|
- return ( flags & CF ) ? ax : 0;
|
121
|
|
-}
|
122
|
|
-#endif /* TRY_FLOPPY_FIRST */
|