Added a bunch of stuff
This commit is contained in:
parent
66350160b0
commit
77c2abd247
66 changed files with 1808 additions and 0 deletions
29
arch/i386/crt0.s
Normal file
29
arch/i386/crt0.s
Normal file
|
@ -0,0 +1,29 @@
|
|||
.section .text
|
||||
.global _start
|
||||
_start:
|
||||
# Set up end of stack frame linked list
|
||||
movl $0, %ebp
|
||||
pushl %ebp # rip = 0
|
||||
pushl %ebp # ebp = 0
|
||||
movl %esp, %ebp
|
||||
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
|
||||
# Prepare signals, memory alloc, stdio, etc.
|
||||
call initialize_standard_library
|
||||
|
||||
# Run global constructors
|
||||
call _init
|
||||
|
||||
# restore argc/argv
|
||||
popl %edi
|
||||
popl %esi
|
||||
|
||||
# Run main
|
||||
call main
|
||||
|
||||
# Terminate with exit code
|
||||
movl %eax, %edi
|
||||
call exit
|
||||
.size _start, . - _start
|
8
arch/i386/inb.s
Normal file
8
arch/i386/inb.s
Normal file
|
@ -0,0 +1,8 @@
|
|||
.globl inb
|
||||
.p2align 2
|
||||
.type inb,%function
|
||||
|
||||
inb:
|
||||
.fnstart
|
||||
|
||||
.fnend
|
Loading…
Add table
Add a link
Reference in a new issue