source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS/Src/Boot/BootVars.asm@ 94

Last change on this file since 94 was 90, checked in by Tomi Tilli, 14 years ago

Changes to XTIDE Universal BIOS:

  • Removed INT 13h format and diagnostics functions.
  • Removed INT 18h callback handler.
  • Removed configuration for early/late initialization. Now XT builds always use late and AT build early initialization.
  • Reduced number of supported IDE controllers from 5 to 4.
  • Removed reserved configuration bytes.
  • Removed simple and system boot loaders.
File size: 2.0 KB
Line 
1; Project name : XTIDE Universal BIOS
2; Description : Functions to access BOOTVARS struct.
3
4; Section containing code
5SECTION .text
6
7;--------------------------------------------------------------------
8; Stores POST stack pointer to BOOTVARS.
9;
10; BootVars_StorePostStackPointer
11; Parameters:
12; DS: BDA and Interrupt Vector segment (zero)
13; Returns:
14; Nothing
15; Corrupts registers:
16; AX
17;--------------------------------------------------------------------
18ALIGN JUMP_ALIGN
19BootVars_StorePostStackPointer:
20 pop ax ; Pop return address
21 mov [BOOTVARS.dwPostStack], sp
22 mov [BOOTVARS.dwPostStack+2], ss
23 jmp ax
24
25
26;--------------------------------------------------------------------
27; Initializes stack for boot menu usage.
28; POST stack is not large enough when DPTs are stored to 30:0h.
29;
30; BootVars_SwitchToBootMenuStack
31; Parameters:
32; Nothing
33; Returns:
34; SS:SP: Pointer to top of Boot Menu stack
35; Corrupts registers:
36; AX
37;--------------------------------------------------------------------
38ALIGN JUMP_ALIGN
39BootVars_SwitchToBootMenuStack:
40 pop ax ; Pop return address
41 cli ; Disable interrupts
42 LOAD_BDA_SEGMENT_TO ss, sp
43 mov sp, BOOTVARS.rgbMnuStack ; Load offset to stack
44 sti ; Enable interrupts
45 jmp ax
46
47
48;--------------------------------------------------------------------
49; Restores SS and SP to initial boot loader values.
50;
51; BootVars_SwitchBackToPostStack
52; Parameters:
53; Nothing
54; Returns:
55; SS:SP: Ptr to POST stack
56; Corrupts registers:
57; AX
58;--------------------------------------------------------------------
59ALIGN JUMP_ALIGN
60BootVars_SwitchBackToPostStack:
61 pop ax ; Pop return address
62 cli ; Disable interrupts
63 LOAD_BDA_SEGMENT_TO ss, sp
64; eLSS sp, ss:BOOTVARS.dwPostStack ; Expanded macro to remove
65 ; unneeded CLI instruction
66%ifndef USE_386
67 mov sp, [ss:BOOTVARS.dwPostStack]
68 mov ss, [ss:BOOTVARS.dwPostStack+2]
69%else
70 lss sp, [ss:BOOTVARS.dwPostStack]
71%endif
72 sti ; Enable interrupts
73 jmp ax
Note: See TracBrowser for help on using the repository browser.