forked from PoliEcho-holding-org/kern
Improved disk building
This commit is contained in:
@@ -5,8 +5,9 @@ Architectural Milestones
|
||||
[-] 64-bit rewrite
|
||||
[x] Limine (Bootloader)
|
||||
[ ] Decent build system (Makefile/CMake with cross-compiler)
|
||||
[ ] kernel.h rewrite & header cleanup
|
||||
[ ] debugf() cleanup & kprintf() (Standardized logging levels)
|
||||
[x] kernel.h rewrite & header cleanup
|
||||
[x] debugf() cleanup, kprintf() & pr_*() (Standardized logging levels)
|
||||
[x] errno.h errors and "errno-in-pointer" macros
|
||||
|
||||
Low-Level Hardware & Interrupts
|
||||
[x] GDT
|
||||
|
||||
@@ -28,11 +28,14 @@ LDFLAGS = -melf_x86_64 -nostdlib -static \
|
||||
ARFLAGS =
|
||||
|
||||
# Kernel config
|
||||
CONSOLE_LOGLEVEL=7
|
||||
CONSOLE_LOGLEVEL = 7
|
||||
|
||||
# Sysroot
|
||||
LIMINE_CFG = ./limine.conf
|
||||
|
||||
# Disk image
|
||||
IMG_NAME = disk.img
|
||||
IMG_SIZE = 256 # 256MB
|
||||
IMG_SIZE = 256
|
||||
|
||||
# Qemu
|
||||
Q_MEMORY = 256M
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
timeout: 0
|
||||
|
||||
/kern.
|
||||
protocol: limine
|
||||
path: boot():/boot/kernel.elf
|
||||
|
||||
@@ -14,8 +14,8 @@ MODULES = $(KERNEL)
|
||||
all: $(TARGET)
|
||||
$(TARGET): $(SYSROOT) $(MODULES)
|
||||
cp /usr/share/limine/limine-bios.sys $(SYSROOT)/boot
|
||||
echo -e 'timeout: 0\n\n/kern.\n\tprotocol: limine\n\tpath: boot():/boot/kernel.elf\n' > $(SYSROOT)/boot/limine.conf
|
||||
dd if=/dev/zero of=$(TARGET) bs=1M count=$(IMG_SIZE)
|
||||
cp $(LIMINE_CFG) $(SYSROOT)/boot/limine.conf
|
||||
qemu-img create $(TARGET) $(IMG_SIZE)M
|
||||
echo ',,c,*' | sfdisk $(TARGET) >/dev/null
|
||||
mformat -F -i $(TARGET)@@$(OFFSET) ::
|
||||
mcopy -i $(TARGET)@@$(OFFSET) $(SYSROOT)/* ::
|
||||
@@ -33,10 +33,10 @@ $(SYSROOT):
|
||||
@mkdir $(SYSROOT)/usr/lib
|
||||
@mkdir $(SYSROOT)/usr/sbin
|
||||
@mkdir $(SYSROOT)/usr/share
|
||||
@mkdir $(SYSROOT)/tmp
|
||||
@ln -s usr/bin $(SYSROOT)/bin
|
||||
@ln -s usr/lib $(SYSROOT)/lib
|
||||
@ln -s usr/sbin $(SYSROOT)/sbin
|
||||
@mkdir $(SYSROOT)/tmp
|
||||
|
||||
$(MODULES):
|
||||
$(MAKE) -C $@ SYSROOT=$(abspath $(SYSROOT))
|
||||
|
||||
Reference in New Issue
Block a user