1 | ; Project name : XTIDE Universal BIOS
|
---|
2 | ; Description : Int 19h BIOS functions for Boot Menu.
|
---|
3 |
|
---|
4 | ; Section containing code
|
---|
5 | SECTION .text
|
---|
6 |
|
---|
7 | ;--------------------------------------------------------------------
|
---|
8 | ; Initial Boot Menu Loader.
|
---|
9 | ; Prepares BOOTVARS for displaying Boot Menu and accepting
|
---|
10 | ; callbacks from INT 18h and 19h.
|
---|
11 | ;
|
---|
12 | ; Int19hMenu_BootLoader
|
---|
13 | ; Parameters:
|
---|
14 | ; Nothing
|
---|
15 | ; Returns:
|
---|
16 | ; Jumps to Int19hMenu_Display, then never returns
|
---|
17 | ;--------------------------------------------------------------------
|
---|
18 | ALIGN JUMP_ALIGN
|
---|
19 | Int19hMenu_BootLoader:
|
---|
20 | LOAD_BDA_SEGMENT_TO ds, ax
|
---|
21 | call BootVars_StorePostStackPointer
|
---|
22 |
|
---|
23 | ; Install new INT 19h handler now that BOOTVARS has been initialized
|
---|
24 | mov WORD [INTV_BOOTSTRAP*4], Int19hMenu_Display
|
---|
25 | mov WORD [INTV_BOOTSTRAP*4+2], cs
|
---|
26 | ; Fall to Int19hMenu_Display
|
---|
27 |
|
---|
28 | ;--------------------------------------------------------------------
|
---|
29 | ; Displays Boot Menu so user can select drive to boot from.
|
---|
30 | ;
|
---|
31 | ; Int19hMenu_Display
|
---|
32 | ; Parameters:
|
---|
33 | ; Nothing
|
---|
34 | ; Returns:
|
---|
35 | ; Never returns
|
---|
36 | ;--------------------------------------------------------------------
|
---|
37 | ALIGN JUMP_ALIGN
|
---|
38 | Int19hMenu_Display:
|
---|
39 | sti ; Enable interrupts
|
---|
40 | call BootVars_SwitchToBootMenuStack
|
---|
41 | call RamVars_GetSegmentToDS
|
---|
42 | ; Fall to Int19hMenu_ProcessMenuSelectionsUntilBootable
|
---|
43 |
|
---|
44 | ;--------------------------------------------------------------------
|
---|
45 | ; Processes user menu selections until bootable drive is selected.
|
---|
46 | ;
|
---|
47 | ; Int19hMenu_ProcessMenuSelectionsUntilBootable
|
---|
48 | ; Parameters:
|
---|
49 | ; DS: RAMVARS segment
|
---|
50 | ; Returns:
|
---|
51 | ; Never returns
|
---|
52 | ;--------------------------------------------------------------------
|
---|
53 | ALIGN JUMP_ALIGN
|
---|
54 | Int19hMenu_ProcessMenuSelectionsUntilBootable:
|
---|
55 | call BootMenu_DisplayAndReturnSelection
|
---|
56 | call DriveXlate_ToOrBack ; Translate drive number
|
---|
57 | call Int19h_TryToLoadBootSectorFromDL
|
---|
58 | jnc SHORT Int19hMenu_ProcessMenuSelectionsUntilBootable ; Boot failure, show menu again
|
---|
59 | call BootVars_SwitchBackToPostStack
|
---|
60 | jmp Int19h_JumpToBootSector
|
---|
61 |
|
---|
62 |
|
---|
63 | ;--------------------------------------------------------------------
|
---|
64 | ; Int19hMenu_RomBoot
|
---|
65 | ; Parameters:
|
---|
66 | ; DS: RAMVARS segment
|
---|
67 | ; Returns:
|
---|
68 | ; Never returns
|
---|
69 | ;--------------------------------------------------------------------
|
---|
70 | ALIGN JUMP_ALIGN
|
---|
71 | Int19hMenu_RomBoot:
|
---|
72 | call BootVars_SwitchBackToPostStack
|
---|
73 | call Int19h_ClearSegmentsForBoot
|
---|
74 | int INTV_BOOT_FAILURE ; Never returns
|
---|