Browse Source

Patched meaty skeleton

master
Leonie 1 year ago
parent
commit
cf50e80826
6 changed files with 14 additions and 15 deletions
  1. +1
    -0
      build.sh
  2. +1
    -1
      clean.sh
  3. +4
    -4
      iso.sh
  4. +6
    -6
      kernel/Makefile
  5. +1
    -1
      libc/include/sys/cdefs.h
  6. +1
    -3
      qemu.sh

+ 1
- 0
build.sh View File

@@ -1,5 +1,6 @@
#!/bin/sh
set -e
. ./clean.sh
. ./headers.sh

for PROJECT in $PROJECTS; do

+ 1
- 1
clean.sh View File

@@ -8,4 +8,4 @@ done

rm -rf sysroot
rm -rf isodir
rm -rf myos.iso
rm -rf frezeos.iso

+ 4
- 4
iso.sh View File

@@ -6,10 +6,10 @@ mkdir -p isodir
mkdir -p isodir/boot
mkdir -p isodir/boot/grub

cp sysroot/boot/myos.kernel isodir/boot/myos.kernel
cp sysroot/boot/kernel.bin isodir/boot/kernel.bin
cat > isodir/boot/grub/grub.cfg << EOF
menuentry "myos" {
multiboot /boot/myos.kernel
menuentry "FreezeOS" {
multiboot /boot/kernel.bin
}
EOF
grub-mkrescue -o myos.iso isodir
grub-mkrescue -o freezeos.iso isodir

+ 6
- 6
kernel/Makefile View File

@@ -50,11 +50,11 @@ $(ARCHDIR)/crtn.o \
.PHONY: all clean install install-headers install-kernel
.SUFFIXES: .o .c .S

all: myos.kernel
all: kernel.bin

myos.kernel: $(OBJS) $(ARCHDIR)/linker.ld
kernel.bin: $(OBJS) $(ARCHDIR)/linker.ld
$(CC) -T $(ARCHDIR)/linker.ld -o [email protected] $(CFLAGS) $(LINK_LIST)
grub-file --is-x86-multiboot myos.kernel
grub-file --is-x86-multiboot kernel.bin

$(ARCHDIR)/crtbegin.o $(ARCHDIR)/crtend.o:
OBJ=`$(CC) $(CFLAGS) $(LDFLAGS) -print-file-name=$(@F)` && cp "$$OBJ" [email protected]
@@ -66,7 +66,7 @@ $(ARCHDIR)/crtbegin.o $(ARCHDIR)/crtend.o:
$(CC) -MD -c $< -o [email protected] $(CFLAGS) $(CPPFLAGS)

clean:
rm -f myos.kernel
rm -f kernel.bin
rm -f $(OBJS) *.o */*.o */*/*.o
rm -f $(OBJS:.o=.d) *.d */*.d */*/*.d

@@ -76,8 +76,8 @@ install-headers:
mkdir -p $(DESTDIR)$(INCLUDEDIR)
cp -R --preserve=timestamps include/. $(DESTDIR)$(INCLUDEDIR)/.

install-kernel: myos.kernel
install-kernel: kernel.bin
mkdir -p $(DESTDIR)$(BOOTDIR)
cp myos.kernel $(DESTDIR)$(BOOTDIR)
cp kernel.bin $(DESTDIR)$(BOOTDIR)

-include $(OBJS:.o=.d)

+ 1
- 1
libc/include/sys/cdefs.h View File

@@ -1,6 +1,6 @@
#ifndef _SYS_CDEFS_H
#define _SYS_CDEFS_H 1

#define __myos_libc 1
#define __freezeos_libc 1

#endif

+ 1
- 3
qemu.sh View File

@@ -1,5 +1,3 @@
#!/bin/sh
set -e
. ./iso.sh

qemu-system-$(./target-triplet-to-arch.sh $HOST) -cdrom myos.iso
qemu-system-i386 -cdrom freezeos.iso

Loading…
Cancel
Save