diff options
| author | Scott Gasch <[email protected]> | 2016-06-01 19:37:09 -0700 |
|---|---|---|
| committer | Scott Gasch <[email protected]> | 2016-06-01 19:37:09 -0700 |
| commit | 0a41dae5f406d498b5c9ab1542cb5660e0d982f6 (patch) | |
| tree | 67ade9fe31cfd0458cc485e95550f7aaf14abdd1 /boot1/hardware.asm | |
Diffstat (limited to 'boot1/hardware.asm')
| -rw-r--r-- | boot1/hardware.asm | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/boot1/hardware.asm b/boot1/hardware.asm new file mode 100644 index 0000000..b7ac3af --- /dev/null +++ b/boot1/hardware.asm @@ -0,0 +1,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 |
