aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArslaan Pathan <[email protected]>2026-03-19 18:04:48 +1300
committerArslaan Pathan <[email protected]>2026-03-19 18:04:48 +1300
commit1814057050a5099d7eaa6f0f6395a4054801da6f (patch)
tree3395c597b100fbe9c53fee9789cc1b016b4b21d4
parent0896c87140db479a5663d40a98c16dafc3d26b67 (diff)
downloadFrenchToastOS-1814057050a5099d7eaa6f0f6395a4054801da6f.tar.xz
FrenchToastOS-1814057050a5099d7eaa6f0f6395a4054801da6f.zip
Fix wrong section (text instead of .text, oops) for entrypoint, change 1M alignment back to 2M, make docker scripts work because arm
-rw-r--r--Makefile18
-rwxr-xr-xinstall-deps-alpine.sh3
-rw-r--r--linker.ld2
-rwxr-xr-xrun-docker.sh8
-rw-r--r--src/boot.s2
5 files changed, 25 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 5920b1b..769f738 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,11 @@
-CC = i686-elf-gcc
-AS = i686-elf-as
+CC = i386-elf-gcc
+AS = i386-elf-as
CFLAGS = -std=gnu99 -ffreestanding -O2 -Wall -Wextra
SRCS = src/kernel.c
OBJS = src/boot.o src/kernel.o
-all: FrenchToastOS.iso
+all: FrenchToastOS-bios.iso FrenchToastOS-efi.iso
src/boot.o: src/boot.s
$(AS) src/boot.s -o src/boot.o
@@ -16,12 +16,18 @@ src/kernel.o: src/kernel.c
FrenchToastOS.bin: $(OBJS)
$(CC) -T linker.ld -o FrenchToastOS.bin -ffreestanding -O2 -nostdlib $(OBJS) -lgcc
-FrenchToastOS.iso: FrenchToastOS.bin
+iso-files: FrenchToastOS.bin
mkdir -p isodir/boot/grub
cp FrenchToastOS.bin isodir/boot/
cp boot/grub.cfg isodir/boot/grub/
- grub-mkrescue -o FrenchToastOS.iso isodir
+
+
+FrenchToastOS-bios.iso: iso-files
+ grub-mkrescue /usr/lib/grub/i386-pc -o FrenchToastOS-bios.iso isodir
+
+FrenchToastOS-efi.iso: iso-files
+ grub-mkrescue -o FrenchToastOS-efi.iso isodir
clean:
- rm -f $(OBJS) FrenchToastOS.bin FrenchToastOS.iso
+ rm -f $(OBJS) FrenchToastOS.bin FrenchToastOS-bios.iso FrenchToastOS-efi.iso
rm -rf isodir
diff --git a/install-deps-alpine.sh b/install-deps-alpine.sh
new file mode 100755
index 0000000..1a91ed1
--- /dev/null
+++ b/install-deps-alpine.sh
@@ -0,0 +1,3 @@
+#!/bin/ash
+
+apk add grub grub-bios gcc-i386-elf binutils-i386-elf make xorriso
diff --git a/linker.ld b/linker.ld
index 0e93f9b..e56537d 100644
--- a/linker.ld
+++ b/linker.ld
@@ -2,7 +2,7 @@ ENTRY(_start)
SECTIONS
{
- . = 1M;
+ . = 2M;
.text BLOCK(4K) : ALIGN(4K)
{
diff --git a/run-docker.sh b/run-docker.sh
new file mode 100755
index 0000000..f4093d2
--- /dev/null
+++ b/run-docker.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+echo "installing binfmt hooks because alarm is bad and it keeps breaking on reboot"
+echo -1 | sudo tee /proc/sys/fs/binfmt_misc/qemu-x86_64
+docker run --privileged --rm tonistiigi/binfmt --install amd64
+
+echo "actually running alpine"
+docker run -it --mount type=bind,src=$(dirname "$0"),target=/workspace --platform linux/amd64 --rm alpine:latest
diff --git a/src/boot.s b/src/boot.s
index 592ba46..80c5738 100644
--- a/src/boot.s
+++ b/src/boot.s
@@ -21,7 +21,7 @@ stack_bottom:
stack_top:
/* _start is the entrypoint */
-.section text
+.section .text
.global _start
.type _start, @function
_start: