commit a1ebf18642867950f088fe721bdf1742f88bec39 from: Onana Onana Xavier Manuel date: Sat Sep 12 03:44:37 2026 UTC Better dd to cover sectors commit - d06837bca243482704cb1f5077d0c180a88f17f9 commit + a1ebf18642867950f088fe721bdf1742f88bec39 blob - a06a60ea20743185ff04fb76ed0216412ab4e647 blob + ba37bbc9df29c2c46b0d4363a0f829bc8971717c --- README +++ README @@ -7,8 +7,20 @@ kernel can be changed by a user through configuration match its platform. This has the benefit of making allocation simply for user -space. +space. There is also no virtual page tables CR3 operations +besides the kernel one to map all memory. The memory is 1 +to 1 mapped to allow usage of the MPU. +Communication among tasks is done through shared buffers +called seats. When the kernel boots, it takes a set amount +of seats represented by a fixed size array. These seats are +all of PAGE_SIZE and can be either vacant or occupied. When +a task wants to communicate wit another it takes a seat +and waits before exchanging information. + +Fragmentation is solved by moving chunks of innactive +threads. + Features: - Buggy blob - f381df207eda12a911d4c84606685a2bcdeb0698 blob + 2f9e39b4b18e87434300955e12d385bf415864ec --- TODO +++ TODO @@ -16,3 +16,6 @@ - Lua C449 compiler, assembler and linker - Rewrite in C449 + +- Create ring buffer to allow asynchronous requests but drop on + full (no blocking or overwritting) blob - 957faa808e32eb75064e7d17ffc19d23cb9148d1 blob + d68f908015ca22dec2be019261b6b627578b3dab --- alpha/build.sh +++ alpha/build.sh @@ -14,13 +14,12 @@ cc -m64 $CFLAGS -o main.o -c main.c $INCS ld \ --defsym=entry=$ALPHA_ENTRY \ -T linker.ld $LFLAGS \ - -o alpha_tmp.bin main.o syscall.o + -o alpha.bin main.o syscall.o -ALPHATMP_SIZE=$(wc -c < alpha_tmp.bin) -ALPHATMP_SECTORS=$(( (ALPHATMP_SIZE + SECTOR_SIZE - 1) / SECTOR_SIZE)) -ALPHA_SIZE=$(((ALPHATMP_SECTORS + 2) * SECTOR_SIZE)) +ALPHA_SIZE=$(wc -c < alpha.bin) +ALPHA_SECTORS=$(( (ALPHA_SIZE + SECTOR_SIZE - 1) / SECTOR_SIZE)) +ALPHA_SIZE=$(((ALPHA_SECTORS + 2) * SECTOR_SIZE)) -cat alpha_tmp.bin /dev/zero | dd of=alpha.bin bs=$ALPHA_SIZE count=1 -rm alpha_tmp.bin +dd if=/dev/null of=alpha.bin bs=1 count=0 seek=$ALPHA_SIZE echo "alpha: done!" blob - 56896c243a94edf9e13fba720973564503dbf7c1 blob + 9159beef07d7a4fcea323c46deff368abf573a71 --- build.sh +++ build.sh @@ -47,15 +47,15 @@ cc -m64 $CFLAGS -o syscalls.o -c $KERNEL_DIR/syscalls. ld \ --defsym=entry=$KERNEL_ENTRY \ -T $KERNEL_DIR/linker.ld $LFLAGS \ - -o kerneli.bin kmain.o io.o kprint.o kmmap.o mem.o \ + -o kernel.bin kmain.o io.o kprint.o kmmap.o mem.o \ switch.o idt.o lidt.o lgdt.o kgdt.o kpic.o syscalls.o \ sysentry.o kthreads.o -KSIZE=$(wc -c < kerneli.bin) +KSIZE=$(wc -c < kernel.bin) KSECTORS=$(( (KSIZE + SECTOR_SIZE - 1) / SECTOR_SIZE + 2)) # Extra sector KSIZE=$((KSECTORS * SECTOR_SIZE)) -cat kerneli.bin /dev/zero | dd of=kernel.bin bs=$KSIZE count=1 +dd if=/dev/null of=kernel.bin bs=1 count=0 seek=$KSIZE nasm \ -D KERNEL_SECTORS=$KSECTORS \ @@ -83,12 +83,13 @@ IMGSIZE=$(((KSECTORS * SECTOR_SIZE) + BOOT_SIZE + ALPH nasm -D STAGE2_SECTORS=$STAGE2_SECTORS boot.s -o boot.bin -cat boot2.bin /dev/zero | dd of=boot2i.bin bs=$STAGE2_SIZE count=1 -cat boot.bin boot2i.bin kernel.bin $ALPHA_BIN $XHCI_BIN /dev/zero | dd of=$OS_NAME bs=$IMGSIZE count=1 +dd if=/dev/null of=boot2.bin bs=1 count=0 seek=$STAGE2_SIZE +cat boot.bin boot2.bin kernel.bin $ALPHA_BIN $XHCI_BIN > $OS_NAME +dd if=/dev/null of=$OS_NAME bs=1 count=0 seek=$IMGSIZE # This is so qemu doesn't bother us but really the OS is not that size if (( IMG_SIZE < 0x100000 )) then - truncate -s 1M $OS_NAME + dd if=/dev/null of=$OS_NAME bs=1 count=0 seek=1M fi echo "$OS_NAME: done!" blob - e69283b1adfb054ff85778f843ca2cc66f2e4b13 blob + 3cf9a7817bf1abdb4622552611080a652e465dca --- servers/xhci/build.sh +++ servers/xhci/build.sh @@ -13,13 +13,12 @@ cc -m64 $CFLAGS -o main.o -c main.c $INCS ld \ --defsym=entry=$XHCI_ENTRY \ -T linker.ld $LFLAGS \ - -o xhci_tmp.bin main.o syscall.o + -o xhci.bin main.o syscall.o -XHCITMP_SIZE=$(wc -c < xhci_tmp.bin) -XHCITMP_SECTORS=$(( (XHCITMP_SIZE + SECTOR_SIZE - 1) / SECTOR_SIZE)) -XHCI_SIZE=$(((XHCITMP_SECTORS) * SECTOR_SIZE)) +XHCI_SIZE=$(wc -c < xhci.bin) +XHCI_SECTORS=$(( (XHCI_SIZE + SECTOR_SIZE - 1) / SECTOR_SIZE)) +XHCI_SIZE=$(((XHCI_SECTORS) * SECTOR_SIZE)) -cat xhci_tmp.bin /dev/zero | dd of=xhci.bin bs=$XHCI_SIZE count=1 -rm xhci_tmp.bin +dd if=/dev/null of=xhci.bin bs=1 count=0 seek=$XHCI_SIZE echo "xhci: done"