Skip to content

Commit 974a7d0

Browse files
committed
some assembly refactorings
1 parent 820034f commit 974a7d0

File tree

9 files changed

+23
-14
lines changed

9 files changed

+23
-14
lines changed

kernel/asm/bootsector.asm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
ORG 0x7C00
2+
SECTION .text
23
USE16
34

45
boot: ; dl comes with disk

kernel/asm/initialize.asm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
SECTION .text
2-
[BITS 16]
2+
USE16
3+
34
initialize:
45
.fpu: ;enable fpu
56
mov eax, cr4

kernel/asm/interrupts-i386.asm

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ struc IDTEntry
1515
.offseth resw 1
1616
endstruc
1717

18-
[section .text]
19-
[BITS 32]
18+
SECTION .text
19+
USE32
20+
2021
interrupts:
2122
.first:
2223
mov [.entry], byte 0
@@ -69,7 +70,7 @@ interrupts:
6970
.entry: dd 0
7071

7172
idtr:
72-
dw (idt_end - idt) + 1
73+
dw (idt.end - idt) + 1
7374
dd idt
7475

7576
idt:
@@ -108,4 +109,4 @@ iend
108109
iend
109110
%assign i i+1
110111
%endrep
111-
idt_end:
112+
.end:

kernel/asm/interrupts-x86_64.asm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ struc IDTEntry
1818
.reserved resd 1
1919
endstruc
2020

21-
[section .text]
22-
[BITS 64]
21+
SECTION .text
22+
USE64
2323
interrupts:
2424
.first:
2525
mov [.entry], byte 0
@@ -94,7 +94,7 @@ interrupts:
9494
.entry: dq 0
9595

9696
idtr:
97-
dw (idt_end - idt) + 1
97+
dw (idt.end - idt) + 1
9898
dq idt
9999

100100
idt:
@@ -139,4 +139,4 @@ iend
139139
iend
140140
%assign i i+1
141141
%endrep
142-
idt_end:
142+
.end:

kernel/asm/memory_map.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
SECTION .text
2-
[BITS 16]
2+
USE16
33
;Generate a memory map at 0x500 to 0x5000 (available memory not used for kernel or bootloader)
44
memory_map:
55
.start equ 0x0500

kernel/asm/print16.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
; provide function for printing in x86 real mode
2-
31
SECTION .text
42
USE16
3+
; provide function for printing in x86 real mode
4+
55

66
; a newline
77
newline: db 0xD, 0xA, 0

kernel/asm/startup-common.asm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
SECTION .text
2+
USE16
3+
14
startup:
25
; enable A20-Line via IO-Port 92, might not work on all motherboards
36
in al, 0x92

kernel/asm/unreal.asm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
SECTION .text
2+
USE16
3+
14
; switch to unreal mode; ds and es can address up to 4GiB
25
unreal:
36
cli

kernel/asm/vesa.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
%include "asm/vesa.inc"
2-
[section .text]
3-
[BITS 16]
2+
SECTION .text
3+
USE16
44
vesa:
55
.getcardinfo:
66
mov ax, 0x4F00

0 commit comments

Comments
 (0)