Added i386 crt's and fixed boot file

This commit is contained in:
lucic71 2020-06-27 13:43:30 +03:00
parent b6f6ce2295
commit 8c3b610da6
5 changed files with 35 additions and 4 deletions

View File

@ -1,4 +1,4 @@
.global loader
.global _start
/* Entry point in the kernel. */
@ -41,10 +41,10 @@
.text
loader:
_start:
mov $kstack, %esp
add KSTACK_SIZE, %esp
add $KSTACK_SIZE, %esp
call kmain
cli

15
kernel/arch/i386/crti.S Normal file
View File

@ -0,0 +1,15 @@
.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. */

9
kernel/arch/i386/crtn.S Normal file
View File

@ -0,0 +1,9 @@
.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

View File

@ -1,4 +1,4 @@
ENTRY(loader)
ENTRY(_start)
SECTIONS {

View File

@ -0,0 +1,7 @@
KERNEL_ARCH_CFLAGS=
KERNEL_ARCH_CPPFLAGS=
KERNEL_ARCH_LDFLAGS=
KERNEL_ARCH_LIBS=
KERNEL_ARCH_OBJS=\
$(ARCHDIR)/boot.o \