<br>
<br>void hd_out(unsigned
int
drive, unsigned
int
nsect, unsigned
int
sect, unsigned
int
head, unsigned
int
cyl, unsigned
int
cmd)
{
unsigned
int
port
=
HD_DATA;
outb_p(
0x00
,
+
+
port);
/
/
error寄存器
outb_p(
0x01
,
+
+
port);
/
/
扇区数
outb_p(
0x00
,
+
+
port);
/
/
LBALow
outb_p(
0x00
,
+
+
port);
/
/
LBAMid
outb_p(
0x00
,
+
+
port);
/
/
LBAHigh
outb_p(
0xe0
,
+
+
port);
/
/
Device寄存器
outb_p(
0x20
,
+
+
port);
/
/
cmd
=
0x20
读
}<br>