source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS/Inc/RamVars.inc@ 326

Last change on this file since 326 was 262, checked in by gregli@…, 13 years ago

More optimizations. Merged RamVars_IsFunction/DriveHandledByThisBIOS in with FindDPT_ForDriveNumber, since they are often used together, making a returned NULL DI pointer indicate a foreign drive in many places. Revamped the iteration done in the handlers for int13/0dh and int13h/0h. Added serial specific print string during drive detection.

File size: 2.9 KB
RevLine 
[88]1; Project name : XTIDE Universal BIOS
[3]2; Description : RAMVARS struct containing BIOS variables stored in RAM.
3%ifndef RAMVARS_INC
4%define RAMVARS_INC
5
6; Segment when RAMVARS is stored to top of interrupt vectors.
[150]7LITE_MODE_RAMVARS_SEGMENT EQU 30h
[3]8
9
10; Variables for translating drive numbers.
11struc XLATEVARS
[258]12%ifdef MODULE_SERIAL_FLOPPY
13 .bFlopCreateCnt:
14 .bFlopCntAndFirst resb 1 ; Normally, packed starting floppy drive number (high order 7 bits)
15 ; and number of drives (low order bit, max 2 drives supported).
16 ; During initialization, until the end of DetectDrives_FromAllIDEControllers,
17 ; this byte contains the raw number of floppy drives seen (using .bFlopCreateCnt)
18%else
19 resb 1 ; alignment
20%endif
[262]21 .bXlatedDrv resb 1 ; Drive number after translation
22 .wFDandHDswap:
23 .bFDSwap resb 1 ; Floppy Drive to swap to 00h and vice versa
24 .bHDSwap resb 1 ; Hard Drive to swap to 80h and vice versa
[3]25endstruc
26
27; RAM Variables.
28; Variables should be kept to minimum since they might be located
29; at the top of interrupt vectors.
30struc RAMVARS
[148]31 .fpOldI13h resb 4 ; Far pointer to old INT 13h handler
[150]32 .wSignature resb 2 ; Sign for finding stolen 1 kiB
[155]33 .bTimeoutTicksLeft resb 1
34 .bLastTimeoutUpdate resb 1
[3]35
36 .wDrvCntAndFirst:
[258]37 .bFirstDrv resb 1 ; Number of first drive for this BIOS
[262]38 .wDrvCntAndFlopCnt: ; Both the hard disk and floppy counts in one word
39 ; (yes, misaligned, but it is only used this way during initialization)
[148]40 .bDrvCnt resb 1 ; Number of drives handled by this BIOS
[3]41
42 ; Variables for drive number translation
43 .xlateVars resb XLATEVARS_size
44endstruc
45
[262]46%ifdef MODULE_SERIAL_FLOPPY
47 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
48 %if RAMVARS.xlateVars != RAMVARS.bDrvCnt+1 || XLATEVARS.bFlopCreateCnt != 0
49 %error "bFlopCreateCnt needs to be the first thing in XLATEVARS, and .xlateVars needs to come immediately after .bDrvCnt. In at least one place, we read .wDrvCntAndFlopCnt to get both counts in one fetch"
50 %endif
51 %endif
52%endif
53
[150]54RAMVARS_SIGNATURE EQU "Xu" ; RAMVARS signature for .wSignature
55
[179]56;
57; IDEPACK NOTE: The first six bytes of this structure are directly put on the
58; wire for MODULE_SERIAL, please do not change the order or insert other members.
59;
[150]60struc IDEPACK
[179]61 .bFeatures resb 1
[150]62 .bDrvAndHead resb 1 ; LBA28 27...24
63
64 .wSectorCountAndLbaLow:
65 .bSectorCount resb 1
66 .bSectorNumber:
67 .bLbaLow resb 1 ; LBA 7...0
68
69 .wCylinder:
70 .wLbaMiddleAndHigh:
71 .bLbaMiddle resb 1 ; LBA 15...8
72 .bLbaHigh resb 1 ; LBA 23...16
73
74 .bCommand resb 1
75 .bDeviceControl resb 1 ; Offset 7 shared with PIOVARS
[218]76 resb 1
[150]77
78 ; Parameters for 48-bit LBA
79 .bLbaLowExt resb 1 ; LBA48 31...24
80 .wLbaMiddleAndHighExt:
81 .bLbaMiddleExt resb 1 ; LBA48 39...32
82 .bLbaHighExt resb 1 ; LBA48 47...40
83
84 .intpack resb INTPACK_size
[3]85endstruc
86
[155]87EXTRA_BYTES_FOR_INTPACK EQU (IDEPACK_size - INTPACK_size)
[3]88
89
90%endif ; RAMVARS_INC
Note: See TracBrowser for help on using the repository browser.