more userspace stuff

This commit is contained in:
2026-07-01 20:00:22 -05:00
parent af6c1c94cf
commit b6ee4fc3de
21 changed files with 161 additions and 121 deletions

View File

@@ -1,24 +1,21 @@
.global _start
.intel_syntax noprefix
.section .text
_start:
xor ebp, ebp
push ebp
mov ebp, esp
xor %ebp, %ebp
push %ebp
mov %esp, %ebp
mov eax, [esp + 4]
lea ebx, [esp + 8]
lea ecx, [esp + 12]
mov (%esp), %eax
lea 4(%esp), %ebx
lea 8(%esp, %eax, 4), %ecx
push ecx
push ebx
push eax
push %ecx
push %ebx
push %eax
call main
push eax
push %eax
call exit
1: hlt
jmp 1b
1: jmp 1b

View File

@@ -1,28 +0,0 @@
# 0 "crt0.S"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "crt0.S"
.global _start
.intel_syntax noprefix
.section .text
_start:
xor ebp, ebp
push ebp
mov ebp, esp
mov eax, [esp + 4]
lea ebx, [esp + 8]
lea ecx, [esp + 12]
push ecx
push ebx
push eax
call main
push eax
call exit
1: hlt
jmp 1b

View File

@@ -1,8 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv) {
printf("Hello, World from RockOS!\n");
int main() {
printf("RockOS booting...\n");
return 0;
}

View File

@@ -8,8 +8,8 @@ TARGET = origin.elf
all: $(TARGET)
crt0.o: crt0.s
$(CC) $(CFLAGS) -c crt0.s -o crt0.o
crt0.o: crt0.S
$(CC) $(CFLAGS) -c crt0.S -o crt0.o
main.o: main.c
$(CC) $(CFLAGS) -c main.c -o main.o