summaryrefslogtreecommitdiff
path: root/asm
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-08-20 00:47:53 +0200
committerMiguel <m.i@gmx.at>2018-08-20 00:47:53 +0200
commit39100c30b7a16103e75187c9840a79c7df54f3da (patch)
treeea54cd41375e3cc38a291dfff47abffbdb468a7e /asm
parentdc5b5d1e5cf82b06fe97ffc8c9374c055e12a748 (diff)
schicophrenic cleanup after realizing many fundamental desgin problems!
Diffstat (limited to 'asm')
-rw-r--r--asm/copy_page_physical.asm33
-rw-r--r--asm/int_clock_handler.asm2
-rw-r--r--asm/int_default_handler.asm6
-rw-r--r--asm/int_kb_handler.asm13
-rw-r--r--asm/int_mouse_handler.asm8
5 files changed, 6 insertions, 56 deletions
diff --git a/asm/copy_page_physical.asm b/asm/copy_page_physical.asm
deleted file mode 100644
index f8d3af1..0000000
--- a/asm/copy_page_physical.asm
+++ /dev/null
@@ -1,33 +0,0 @@
-[bits 32]
-
-global copy_page_physical
-copy_page_physical:
- push ebx ; According to __cdecl, we must preserve the contents of EBX.
- pushf ; push EFLAGS, so we can pop it and reenable interrupts
- ; later, if they were enabled anyway.
- cli ; Disable interrupts, so we aren't interrupted.
- ; Load these in BEFORE we disable paging!
- mov ebx, [esp+12] ; Source address
- mov ecx, [esp+16] ; Destination address
-
- mov edx, cr0 ; Get the control register...
- and edx, 0x7fffffff ; and...
- mov cr0, edx ; Disable paging.
-
- mov edx, 1024 ; 1024*4bytes = 4096 bytes to copy
-
-.loop:
- mov eax, [ebx] ; Get the word at the source address
- mov [ecx], eax ; Store it at the dest address
- add ebx, 4 ; Source address += sizeof(word)
- add ecx, 4 ; Dest address += sizeof(word)
- dec edx ; One less word to do
- jnz .loop
-
- mov edx, cr0 ; Get the control register again
- or edx, 0x80000000 ; and...
- mov cr0, edx ; Enable paging.
-
- popf ; Pop EFLAGS back.
- pop ebx ; Get the original value of EBX back.
- ret
diff --git a/asm/int_clock_handler.asm b/asm/int_clock_handler.asm
index 7b0afaf..f6c056a 100644
--- a/asm/int_clock_handler.asm
+++ b/asm/int_clock_handler.asm
@@ -5,7 +5,6 @@ global int_clock_handler
int_clock_handler:
-cli
pusha ;Push all standard registers
mov eax, esp ;save current stack pointer in esp
@@ -20,6 +19,5 @@ mov al, 0x20 ;Port number AND command number to Acknowledge IRQ
out 0x20, al ;Acknowledge IRQ, so we keep getting interrupts
popa ;Put the standard registers back
-sti
iretd ;Interrupt-Return
diff --git a/asm/int_default_handler.asm b/asm/int_default_handler.asm
index b86eeae..00aa1ac 100644
--- a/asm/int_default_handler.asm
+++ b/asm/int_default_handler.asm
@@ -1,12 +1,9 @@
global int_default_handler
[extern int_default]
-
[bits 32]
int_default_handler:
-
- cli
pusha
call int_default
@@ -15,7 +12,4 @@ int_default_handler:
out 0x20, al ;Acknowledge IRQ, so we keep getting interrupts
popa
- sti
-
-
iret ;Interrupt-Return
diff --git a/asm/int_kb_handler.asm b/asm/int_kb_handler.asm
index acf6208..cd1b32c 100644
--- a/asm/int_kb_handler.asm
+++ b/asm/int_kb_handler.asm
@@ -6,9 +6,7 @@ global int_kb_handler
int_kb_handler:
-cli
-
-pusha
+ pusha
mov eax,0x0
in al,0x60
@@ -17,13 +15,10 @@ pusha
call keyboard_handle
pop eax
-; call int_default
-
- mov al, 0x20 ;Port number AND command number to Acknowledge IRQ
- out 0x20, al ;Acknowledge IRQ, so we keep getting interrupts
-popa
+ mov al, 0x20 ;Port number AND command number to Acknowledge IRQ
+ out 0x20, al ;Acknowledge IRQ, so we keep getting interrupts
-sti
+ popa
iretd ;Interrupt-Return
diff --git a/asm/int_mouse_handler.asm b/asm/int_mouse_handler.asm
index 4e4882b..6872af0 100644
--- a/asm/int_mouse_handler.asm
+++ b/asm/int_mouse_handler.asm
@@ -2,18 +2,14 @@ global int_mouse_handler
[extern mouse_handler]
[bits 32]
-int_mouse_handler:
-
- cli
- pusha
+int_mouse_handler:
+ pusha
call mouse_handler
mov al, 0x20 ;Port number AND command number to Acknowledge IRQ
out 0xa0, al ; came from slave
out 0x20, al ;Acknowledge IRQ, so we keep getting interrupts
-
popa
- sti
iret ;Interrupt-Return