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

Last change on this file since 359 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
Line 
1; Project name : XTIDE Universal BIOS
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.
7LITE_MODE_RAMVARS_SEGMENT EQU 30h
8
9
10; Variables for translating drive numbers.
11struc XLATEVARS
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
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
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
31 .fpOldI13h resb 4 ; Far pointer to old INT 13h handler
32 .wSignature resb 2 ; Sign for finding stolen 1 kiB
33 .bTimeoutTicksLeft resb 1
34 .bLastTimeoutUpdate resb 1
35
36 .wDrvCntAndFirst:
37 .bFirstDrv resb 1 ; Number of first drive for this BIOS
38 .wDrvCntAndFlopCnt: ; Both the hard disk and floppy counts in one word
39 ; (yes, misaligned, but it is only used this way during initialization)
40 .bDrvCnt resb 1 ; Number of drives handled by this BIOS
41
42 ; Variables for drive number translation
43 .xlateVars resb XLATEVARS_size
44endstruc
45
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
54RAMVARS_SIGNATURE EQU "Xu" ; RAMVARS signature for .wSignature
55
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;
60struc IDEPACK
61 .bFeatures resb 1
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
76 resb 1
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
85endstruc
86
87EXTRA_BYTES_FOR_INTPACK EQU (IDEPACK_size - INTPACK_size)
88
89
90%endif ; RAMVARS_INC
Note: See TracBrowser for help on using the repository browser.