CC = gcc
-CFLAGS = -g -c -fno-builtin
+CFLAGS = -g -c -fno-builtin -m32
SYSTEMMAP = System.map
KERNELBIN = KERNEL.BIN
LINKSCRIPT = scripts/link.ld
OBJS := $(patsubst %,%.o,$(SOURCE_FILES))
${KERNELBIN}: ${OBJS}
- ld -M -T$(LINKSCRIPT) $(OBJS) -o $@ > $(SYSTEMMAP)
+ ld -m elf_i386 -M -T$(LINKSCRIPT) $(OBJS) -o $@ > $(SYSTEMMAP)
rm kernel/setup.c.o
%.S.o: %.S ${HEADER_FILES}
CC = gcc
LDFLAG = -e _start
-CFLAGS = -c -I../include -fno-builtin
+CFLAGS = -m32 -c -I../include -fno-builtin
LIBC_DIRS = ../lib
LIBC_SRCS := $(foreach DIR, $(LIBC_DIRS), $(wildcard $(DIR)/*.[cS]))
LIBC_OBJS := $(patsubst %,%.o,$(LIBC_SRCS))
#include <errno.h>
#include <fs.h>
#include <sched.h>
-#include <memory.h>
int sysc_stat(int fd, struct stat *stat)
{
#if 0
return pid;
}
-inline void load_cr3(task_union *tsk)
+void load_cr3(task_union *tsk)
{
LOAD_CR3(tsk->cr3);
}
return 0;
}
-inline void set_esp0(task_union * tsk)
+void set_esp0(task_union * tsk)
{
tss.esp0 = tsk->esp0;
}
-inline void switch_to()
+void switch_to()
{
LOAD_CR3(current->cr3);
set_esp0(current);
}
-inline void context_switch(task_union * prev, task_union * next)
+void context_switch(task_union * prev, task_union * next)
{
unsigned long eax, ebx, ecx, edx, esi, edi;
asm volatile(
#include <syscall.h>
#include <stat.h>
-inline int _stat(int fd, struct stat *stat)
+int _stat(int fd, struct stat *stat)
{
return syscall2(SYSC_STAT, fd, stat);
}
sleep 1
-partx -a ${lodev}
+#partx -a ${lodev}
-sleep 1
+#sleep 1
ls -l ${lodev}*
echo "(hd0) ${lodev}" > ${TMP}/device.map
+mkdir -p ${MNT}/boot/grub2/
+
grub2-install --target=i386-pc \
--grub-mkdevicemap=${TMP}/device.map \
--modules="biosdisk part_msdos ext2 configfile normal multiboot" \