summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
authorErwan Velu <erwan.velu@free.fr>2009-02-11 23:49:15 +0100
committerH. Peter Anvin <hpa@zytor.com>2009-02-25 20:58:40 -0800
commit1b520a5888c0313d2741943d99835f7307447611 (patch)
tree0ca90a6d39d32ebc7f6d9dddde49b78e35dd3654 /sample
parent53abd39e9dfdecf607105afcbf70c83028f253db (diff)
downloadsyslinux-1b520a5888c0313d2741943d99835f7307447611.tar.gz
hdt: Fixing device parameter structure
Diffstat (limited to 'sample')
-rw-r--r--sample/hdt.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sample/hdt.c b/sample/hdt.c
index 5de75cd5..808555cf 100644
--- a/sample/hdt.c
+++ b/sample/hdt.c
@@ -81,11 +81,15 @@ struct ebios_dapa {
uint64_t lba;
};
+// BYTE=8
+// WORD=16
+// DWORD=32
+// QWORD=64
struct device_parameter {
uint16_t len;
uint16_t info;
uint32_t cylinders;
- uint32_t head;
+ uint32_t heads;
uint32_t sectors_per_track;
uint64_t sectors;
uint16_t bytes_per_sector;
@@ -94,10 +98,10 @@ struct device_parameter {
uint8_t device_path_lenght;
uint8_t device_path_reserved;
uint16_t device_path_reserved_2;
- char host_bus_type[4];
- char interface_type[8];
- uint32_t interace_path;
- uint32_t device_path[2];
+ uint8_t host_bus_type[4];
+ uint8_t interface_type[8];
+ uint64_t interace_path;
+ uint64_t device_path[2];
uint8_t reserved;
uint8_t cheksum;
};
@@ -264,10 +268,12 @@ static int get_disk_params(int disk, struct diskinfo *disk_info)
__intcall(0x13, &inreg, &outreg);
- if ( parm.eflags.l & EFLAGS_CF )
+ if ( outreg.eflags.l & EFLAGS_CF )
printf("Error while detecting disk parameters\n");
printf("RESULT=0x%X 0x%X 0x%X 0x%X\n",dp->host_bus_type[0],dp->host_bus_type[1],dp->host_bus_type[2],dp->host_bus_type[3]);
+ printf("RESULT=0x%X 0x%X 0x%X 0x%X\n",dp->interface_type[0],dp->interface_type[1],dp->interface_type[2],dp->interface_type[3]);
+ printf("RESULT= cylindres=%d heads=%d sect=%d bytes_per_sector=%d\n",dp->cylinders, dp->heads,dp->sectors/2/1024,dp->bytes_per_sector);
return 0;
}