+ printf("pkt_size: %x\n", pkt.packet_size);
+ printf("media_type: %x\n", pkt.media_type);
+ printf("drive_num: %x\n", pkt.drive_num);
+ printf("device_spec: %x\n", pkt.device_spec);
+ printf("press a key->\n");getc();
+#endif
+
+ /* Some BIOSes erroneously return cf = 1 */
+ /* Just check to see if the drive number is the same. */
+ if (pkt.drive_num == drive) {
+ if ((pkt.media_type & 0x0F) == 0) {
+ /* We are in no-emulation mode. */
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+#if DEBUG
+/*
+ * BIOS drive information.
+ */
+void print_drive_info(boot_drive_info_t *dp)
+{
+ // printf("buf_size = %x\n", dp->params.buf_size);
+ printf("info_flags = %x\n", dp->params.info_flags);
+ printf(" phys_cyls = %lx\n", dp->params. phys_cyls);
+ printf(" phys_heads = %lx\n", dp->params. phys_heads);
+ printf(" phys_spt = %lx\n", dp->params. phys_spt);
+ printf("phys_sectors = %lx%lx\n", ((unsigned long *)(&dp->params.phys_sectors))[1],
+ ((unsigned long *)(&dp->params.phys_sectors))[0]);
+ printf("phys_nbps = %x\n", dp->params.phys_nbps);
+ // printf("dpte_offset = %x\n", dp->params.dpte_offset);
+ // printf("dpte_segment = %x\n", dp->params.dpte_segment);
+ // printf("key = %x\n", dp->params.key);
+ // printf("path_len = %x\n", dp->params. path_len);
+ // printf("reserved1 = %x\n", dp->params. reserved1);
+ // printf("reserved2 = %x\n", dp->params.reserved2);
+ //printf("bus_type[4] = %x\n", dp->params. bus_type[4]);
+ //printf("interface_type[8] = %x\n", dp->params. interface_type[8]);
+ //printf("interface_path[8] = %x\n", dp->params. interface_path[8]);
+ //printf("dev_path[8] = %x\n", dp->params. dev_path[8]);
+ // printf("reserved3 = %x\n", dp->params. reserved3);
+ // printf("checksum = %x\n", dp->params. checksum);
+
+ printf(" io_port_base = %x\n", dp->dpte.io_port_base);
+ printf(" control_port_base = %x\n", dp->dpte.control_port_base);
+ printf(" head_flags = %x\n", dp->dpte. head_flags);
+ printf(" vendor_info = %x\n", dp->dpte. vendor_info);
+ printf(" irq = %x\n", dp->dpte. irq);
+ // printf(" irq_unused = %x\n", dp->dpte. irq_unused);
+ printf(" block_count = %x\n", dp->dpte. block_count);
+ printf(" dma_channe = %x\n", dp->dpte. dma_channel);
+ printf(" dma_type = %x\n", dp->dpte. dma_type);
+ printf(" pio_type = %x\n", dp->dpte. pio_type);
+ printf(" pio_unused = %x\n", dp->dpte. pio_unused);
+ printf(" option_flags = %x\n", dp->dpte.option_flags);
+ // printf(" reserved = %x\n", dp->dpte.reserved);
+ printf(" revision = %x\n", dp->dpte. revision);
+ // printf(" checksum = %x\n", dp->dpte. checksum);
+}
+
+#endif
+
+int get_drive_info(int drive, struct driveInfo *dp)
+{
+ boot_drive_info_t *di = &dp->di;
+ int ret = 0;
+
+#if 0