summaryrefslogtreecommitdiff
path: root/src/as
diff options
context:
space:
mode:
Diffstat (limited to 'src/as')
-rw-r--r--src/as/boot.s30
-rw-r--r--src/as/crti.s16
-rw-r--r--src/as/crtn.s10
-rw-r--r--src/as/gdt.s6
-rw-r--r--src/as/idt.s7
-rw-r--r--src/as/ioport.s13
6 files changed, 27 insertions, 55 deletions
diff --git a/src/as/boot.s b/src/as/boot.s
index 907cd3c..f65cc72 100644
--- a/src/as/boot.s
+++ b/src/as/boot.s
@@ -10,35 +10,6 @@
.long FLAGS
.long CHECKSUM
-.global _start
-.global load_gdt
-.global load_idt
-.global enable_interrupts
-.global ioport_in
-.global ioport_out
-
-load_gdt:
- movl 4(%esp), %edx
- lgdt (%edx)
- ret
-
-load_idt:
- movl 4(%esp), %edx
- lidt (%edx)
- sti
- ret
-
-ioport_in:
- movl 4(%esp),%edx
- in %dx,%al
- ret
-
-ioport_out:
- movl 4(%esp),%edx
- movl 8(%esp),%eax
- outb %al,%dx
- ret
-
.set CODE_SEGMENT, 0x08
.set DATA_SEGMENT, 0x10
@@ -49,6 +20,7 @@ stack_bottom:
stack_top:
.section .text
+.global _start
.type _start, @function
_start:
call init_gdt_table
diff --git a/src/as/crti.s b/src/as/crti.s
deleted file mode 100644
index 5894e2d..0000000
--- a/src/as/crti.s
+++ /dev/null
@@ -1,16 +0,0 @@
-/* x86 crti.s */
-.section .init
-.global _init
-.type _init, @function
-_init:
- push %ebp
- movl %esp, %ebp
- /* gcc will nicely put the contents of crtbegin.o's .init section here. */
-
-.section .fini
-.global _fini
-.type _fini, @function
-_fini:
- push %ebp
- movl %esp, %ebp
- /* gcc will nicely put the contents of crtbegin.o's .fini section here. */
diff --git a/src/as/crtn.s b/src/as/crtn.s
deleted file mode 100644
index 0e1c314..0000000
--- a/src/as/crtn.s
+++ /dev/null
@@ -1,10 +0,0 @@
-/* x86 crtn.s */
-.section .init
- /* gcc will nicely put the contents of crtend.o's .init section here. */
- popl %ebp
- ret
-
-.section .fini
- /* gcc will nicely put the contents of crtend.o's .fini section here. */
- popl %ebp
- ret
diff --git a/src/as/gdt.s b/src/as/gdt.s
new file mode 100644
index 0000000..632bd3e
--- /dev/null
+++ b/src/as/gdt.s
@@ -0,0 +1,6 @@
+.global load_gdt
+
+load_gdt:
+ movl 4(%esp), %edx
+ lgdt (%edx)
+ ret
diff --git a/src/as/idt.s b/src/as/idt.s
new file mode 100644
index 0000000..e95b42b
--- /dev/null
+++ b/src/as/idt.s
@@ -0,0 +1,7 @@
+.global load_idt
+
+load_idt:
+ movl 4(%esp), %edx
+ lidt (%edx)
+ sti
+ ret
diff --git a/src/as/ioport.s b/src/as/ioport.s
new file mode 100644
index 0000000..f4b4dbd
--- /dev/null
+++ b/src/as/ioport.s
@@ -0,0 +1,13 @@
+.global ioport_in
+.global ioport_out
+
+ioport_in:
+ movl 4(%esp),%edx
+ in %dx,%al
+ ret
+
+ioport_out:
+ movl 4(%esp),%edx
+ movl 8(%esp),%eax
+ outb %al,%dx
+ ret