Feat: Keyboard strokes working and in buffer

This commit is contained in:
AfonsoCMSousa
2026-08-05 02:23:54 +01:00
parent fb27ad1e0c
commit ba16f38c79
6 changed files with 161 additions and 56 deletions
+14 -9
View File
@@ -24,22 +24,27 @@ echo -e "${GREEN}✓${NC} Folders created.${NC}"
echo -e "${BLUE}[1/6]${NC} Assembling Stage 1 bootloader (MBR)..."
nasm -f bin ./boot/boot.asm -o ./bin/boot.bin
# Step 2: Assemble Stage 2 bootloader (extended loader)
echo -e "${BLUE}[2/6]${NC} Assembling Stage 2 bootloader..."
nasm -f bin ./boot/elevator.asm -o ./bin/elevator.bin
# Step 2: Compile kernel C code
echo -e "${BLUE}[2/6]${NC} Compiling kernel..."
gcc -ffreestanding -c kernel.c -o ./obj/kernel.c.o -mcmodel=large -mno-red-zone -fno-pic -fno-pie -static -fno-stack-protector -nostdlib -mno-mmx -mno-sse -mno-sse2 -m64
# Step 3: Assemble kernel entry point
echo -e "${BLUE}[3/6]${NC} Assembling kernel entry..."
nasm -f elf64 ./boot/kernel.asm -o ./obj/kernel.asm.o
# Step 4: Compile kernel C code
echo -e "${BLUE}[4/6]${NC} Compiling kernel..."
gcc -ffreestanding -c kernel.c -o ./obj/kernel.c.o -mcmodel=large -mno-red-zone -fno-pic -fno-pie -static -fno-stack-protector -nostdlib -mno-mmx -mno-sse -mno-sse2 -m64
# Step 5: Link kernel
echo -e "${BLUE}[5/6]${NC} Linking kernel..."
# Step 4: Link kernel
echo -e "${BLUE}[4/6]${NC} Linking kernel..."
ld -T linker.ld -o ./bin/kernel.bin ./obj/kernel.asm.o ./obj/kernel.c.o --oformat binary --nostdlib
# Step 4.5: Calculate kernel size in sectors
KERNEL_SIZE=$(stat -f%z ./bin/kernel.bin 2>/dev/null || stat -c%s ./bin/kernel.bin 2>/dev/null)
SECTORS=$(( (KERNEL_SIZE + 511) / 512 )) #Round up to nearest sector
echo -e "${YELLOW}Kernel size: ${KERNEL_SIZE} bytes, which is ${SECTORS} sectors.${NC}"
# Step 5: Assemble Stage 2 bootloader (extended loader)
echo -e "${BLUE}[5/6]${NC} Assembling Stage 2 bootloader..."
nasm -f bin ./boot/elevator.asm -D KERNEL_SECTORS=$SECTORS -o ./bin/elevator.bin
# Step 6: Create OS image
echo -e "${BLUE}[6/6]${NC} Creating OS image..."
cat ./bin/boot.bin ./bin/elevator.bin ./bin/kernel.bin > os.bin