diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2008-12-31 00:09:28 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2008-12-31 00:09:28 -0500 |
commit | 4a16ef64acb83df452576560ba327a8b09213280 (patch) | |
tree | bb99fd99141126f770932bcdad97c59a3bd8c318 /src/disk.c | |
parent | 08815370c94d88b37bc651d6707b6f1d68dc519b (diff) | |
download | seabios-hppa-4a16ef64acb83df452576560ba327a8b09213280.zip seabios-hppa-4a16ef64acb83df452576560ba327a8b09213280.tar.gz seabios-hppa-4a16ef64acb83df452576560ba327a8b09213280.tar.bz2 |
Return CDEMU parameters to ebda segment (instead of using globals).
The cdemu is setup in the boot stage after globals are made
read-only. So, globals can't be used.
Also, move hdcount from a global to BDA (it should be in BDA).
Don't attempt to set blksize/sector count in atapi_is_ready() - it's
not useful.
Diffstat (limited to 'src/disk.c')
-rw-r--r-- | src/disk.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -50,9 +50,10 @@ basic_access(struct bregs *regs, u8 device, u16 command) nlspt = GET_GLOBAL(ATA.devices[device].lchs.spt); } else { // Must be cd emulation. - nlc = GET_GLOBAL(CDEMU.vdevice.cylinders); - nlh = GET_GLOBAL(CDEMU.vdevice.heads); - nlspt = GET_GLOBAL(CDEMU.vdevice.spt); + u16 ebda_seg = get_ebda_seg(); + nlc = GET_EBDA2(ebda_seg, cdemu.cylinders); + nlh = GET_EBDA2(ebda_seg, cdemu.heads); + nlspt = GET_EBDA2(ebda_seg, cdemu.spt); } u16 count = regs->al; @@ -219,7 +220,7 @@ disk_1308(struct bregs *regs, u8 device) u16 nlc = GET_GLOBAL(ATA.devices[device].lchs.cylinders); u16 nlh = GET_GLOBAL(ATA.devices[device].lchs.heads); u16 nlspt = GET_GLOBAL(ATA.devices[device].lchs.spt); - u16 count = GET_GLOBAL(ATA.hdcount); + u16 count = GET_BDA(hdcount); nlc = nlc - 2; /* 0 based , last sector not used */ regs->al = 0; @@ -662,8 +663,9 @@ handle_13(struct bregs *regs) cdemu_134b(regs); return; } - if (GET_EBDA(cdemu_active)) { - if (drive == GET_GLOBAL(CDEMU.emulated_drive)) { + u16 ebda_seg = get_ebda_seg(); + if (GET_EBDA2(ebda_seg, cdemu.active)) { + if (drive == GET_EBDA2(ebda_seg, cdemu.emulated_drive)) { cdemu_13(regs); return; } |