summaryrefslogtreecommitdiff
path: root/boot1/hardware.asm
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2016-06-01 19:37:09 -0700
committerScott Gasch <[email protected]>2016-06-01 19:37:09 -0700
commit0a41dae5f406d498b5c9ab1542cb5660e0d982f6 (patch)
tree67ade9fe31cfd0458cc485e95550f7aaf14abdd1 /boot1/hardware.asm
Initial checkin of toy OS project.HEADmaster
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