forked from PoliEcho-holding-org/kern
Fixed everything to work with the new libc
This commit is contained in:
+1
-1
@@ -2,10 +2,10 @@
|
||||
#include <fs/fs.h>
|
||||
#include <memory/addresses.h>
|
||||
#include <disk/disk.h>
|
||||
#include <syscall.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
superblock_t* impl_superblock = (superblock_t*)SUPERBLOCK_LOC;
|
||||
fsInfo_t* fsInfo = (fsInfo_t*)FS_INFO_LOC;
|
||||
|
||||
+2
-2
@@ -6,12 +6,12 @@ include make.defaults
|
||||
|
||||
LIBK_ASM=$(LIBK_DIR)/interrupt/isr.s
|
||||
|
||||
$(LIBK): $(LIBK_SRC) $(LIBK_ASM)
|
||||
$(LIBK): $(LIBK_SRC) $(LIBK_ASM) $(LIBC)
|
||||
@echo "Building $(LIBK)..."
|
||||
nasm -felf32 -o $(BIN)/libk/isr_asm.o $(LIBK_ASM)
|
||||
for f in $(LIBK_SRC); do\
|
||||
filename=$$(basename $$f .c);\
|
||||
$(CC) $(CFLAGS) -I$(LIBC_INC) -I$(LIBK_INC) -o $(BIN)/libk/$$filename.o -c $$f;\
|
||||
done
|
||||
$(LD) $(LDFLAGS) -r -o $(LIBK) $(BIN)/libk/**.o
|
||||
$(LD) $(LDFLAGS) -r -o $(LIBK) $(LIBC) $(BIN)/libk/**.o
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
int sys_read(intFrame_t* iframe) {
|
||||
char* s = (char*)iframe->ebx;
|
||||
reads(s);
|
||||
gets(s, 0xffffffff);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <syscall.h>
|
||||
|
||||
// System call table
|
||||
int (*syscalls[MAX_SYSCALLS])(intFrame_t*) = {
|
||||
int (*syscalls[SYSCALL_COUNT])(intFrame_t*) = {
|
||||
[SYS_EXIT] = sys_exit,
|
||||
[SYS_READ] = sys_read,
|
||||
[SYS_WRITE] = sys_write,
|
||||
@@ -18,7 +18,7 @@ int (*syscalls[MAX_SYSCALLS])(intFrame_t*) = {
|
||||
|
||||
// Syscall handler
|
||||
int syscallHandler(intFrame_t* iframe) {
|
||||
if (iframe->eax > MAX_SYSCALLS-1) { // Syscall doesn't exist
|
||||
if (iframe->eax > SYSCALL_COUNT-1) { // Syscall doesn't exist
|
||||
debugf("Error: Syscall(%d) does not exist!\n", iframe->eax);
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user