1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
[BITS 16]
;;; Call BIOS to populate equipment bitv in the HARDWARE buffer.
GET_EQUIPMENT_LIST:
xor ax, ax
int 0x11
mov [wEquipmentBitvector], ax
ret
;;; Call BIOS to get the system memory size.
GET_MEMORY_SIZE:
xor ax, ax
mov ah, 0x88
int 0x15
add ax, 1024
mov [wMemorySize], ax
ret
GET_TIME:
xor ax, ax
int 0x1a
push es
push si
mov es, cx
mov si, dx
mov cx, WORD [es:si]
mov [wSystemClock], cx
pop si
pop es
ret
; Enable the A20 address line, so we can correctly address
; memory above 1MB.
ENABLE_A20:
mov al, 0xD1
out 0x64, al
nop
jmp .here
.here: mov al, 0xDF
out 0x60, al
nop
jmp .there
.there: ret
|