summaryrefslogtreecommitdiff
path: root/asm
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-09-09 00:26:30 +0200
committerMiguel <m.i@gmx.at>2018-09-09 00:26:30 +0200
commit9dabe01545644dd78448d8d489616872f14d964b (patch)
tree83a939a54ffa27f575dbdf930140b8353f54365c /asm
parent9fde748acea83d775e367a64858414b674f05b13 (diff)
lapic bus speed probing and starting switch to ioapic
Diffstat (limited to 'asm')
-rw-r--r--asm/asm_pic.asm6
-rw-r--r--asm/asm_pit.s22
2 files changed, 18 insertions, 10 deletions
diff --git a/asm/asm_pic.asm b/asm/asm_pic.asm
index 2514be7..8a90fdf 100644
--- a/asm/asm_pic.asm
+++ b/asm/asm_pic.asm
@@ -78,6 +78,12 @@ in al, 0xA1 ; read in the primary PIC Interrupt Mask Register (IMR)
and al, 0x00 ; 0xEF => 11101111b. This sets the IRQ4 bit (Bit 5) in AL
out 0xA1, al ; write the value back into IMR
+;disable
+
+;mov al, 0xff
+;out 0xa1, al
+;out 0x21, al
+
ret
;;;;;;;;;;;;;;;;;;;;
diff --git a/asm/asm_pit.s b/asm/asm_pit.s
index 8be29cb..28fd784 100644
--- a/asm/asm_pit.s
+++ b/asm/asm_pit.s
@@ -49,7 +49,7 @@ asm_pit_tick:
.macro asm_pit_sleep val
- mov $0x00110000, %al // chan 0 / mode 0
+ mov $0b00110000, %al // chan 0 / mode 0
outb %al,$0x43
// LSB first
@@ -57,18 +57,20 @@ asm_pit_tick:
out %al, $0x40
xchg %ah,%al
out %al, $0x40
-
- // check if finished
- mov $0xE2, %al
- outb %al,$0x43
//sleep until finished
- //7th bit determines if finished
+ //7th bit (0-7) determines if finished
sleep\val:
- inb $0x40, %al
- or $0b1000000, %al
- cmp $0b1000000, %al
- jne sleep\val
+
+ // read back command
+ mov $0b11100010, %al
+ outb %al,$0x43
+
+ inb $0x40, %al
+ and $0b10000000, %al
+
+ cmp $0b10000000, %al
+ jne sleep\val
ret