summaryrefslogtreecommitdiff
path: root/boot1/hardware.asm
diff options
context:
space:
mode:
Diffstat (limited to 'boot1/hardware.asm')
-rw-r--r--boot1/hardware.asm42
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