diff options
| -rw-r--r-- | Dockerfile | 43 | ||||
| -rw-r--r-- | Makefile | 15 | ||||
| -rw-r--r-- | boot/grub.cfg | 14 | ||||
| -rwxr-xr-x | install-deps-alpine.sh | 6 | ||||
| -rwxr-xr-x | run-docker.sh | 11 | ||||
| -rw-r--r-- | src/boot.s | 2 |
6 files changed, 64 insertions, 27 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4395562 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,43 @@ +FROM ubuntu:latest + +# debug uname +RUN uname -a + +RUN apt-get update && apt-get install -y \ + build-essential \ + bison \ + flex \ + libgmp3-dev \ + libmpc-dev \ + libmpfr-dev \ + texinfo \ + wget \ + grub-common \ + grub-pc-bin \ + grub-efi-ia32-bin \ + xorriso \ + mtools \ + make + +WORKDIR /tmp +RUN wget https://ftp.gnu.org/gnu/binutils/binutils-2.41.tar.gz && \ + tar -xf binutils-2.41.tar.gz && \ + mkdir build-binutils && cd build-binutils && \ + ../binutils-2.41/configure --target=i686-elf --prefix=/opt/cross --disable-nls --disable-werror && \ + make -j$(nproc) && \ + make install && \ + cd /tmp && rm -rf binutils-2.41* build-binutils + +RUN wget https://ftp.gnu.org/gnu/gcc/gcc-13.2.0/gcc-13.2.0.tar.gz && \ + tar -xf gcc-13.2.0.tar.gz && \ + mkdir build-gcc && cd build-gcc && \ + ../gcc-13.2.0/configure --target=i686-elf --prefix=/opt/cross --disable-nls --enable-languages=c,c++ --without-headers && \ + make all-gcc -j$(nproc) && \ + make all-target-libgcc -j$(nproc) && \ + make install-gcc && \ + make install-target-libgcc && \ + cd /tmp && rm -rf gcc-13.2.0* build-gcc + +ENV PATH="/opt/cross/bin:${PATH}" + +WORKDIR /workspace @@ -1,12 +1,12 @@ -CC = i386-elf-gcc -AS = i386-elf-as +CC = i686-elf-gcc +AS = i686-elf-as CFLAGS = -std=gnu99 -ffreestanding -O2 -Wall -Wextra OBJS = src/boot.o src/kernel.o .PHONY: all clean iso-files -all: FrenchToastOS-bios.iso FrenchToastOS-efi.iso +all: FrenchToastOS.iso src/boot.o: src/boot.s $(AS) src/boot.s -o src/boot.o @@ -22,12 +22,9 @@ iso-files: FrenchToastOS.bin cp FrenchToastOS.bin isodir/boot/ cp boot/grub.cfg isodir/boot/grub/ -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 +FrenchToastOS.iso: iso-files + grub-mkrescue /usr/lib/grub/i386-pc /usr/lib/grub/i386-efi /usr/lib/grub/x86_64-efi -o FrenchToastOS.iso isodir clean: - rm -f $(OBJS) FrenchToastOS.bin FrenchToastOS-bios.iso FrenchToastOS-efi.iso + rm -f $(OBJS) FrenchToastOS.bin FrenchToastOS.iso rm -rf isodir diff --git a/boot/grub.cfg b/boot/grub.cfg index 8a730f9..8cef020 100644 --- a/boot/grub.cfg +++ b/boot/grub.cfg @@ -1,8 +1,20 @@ # Copyright (c) 2026 Arslaan Pathan # This software is licensed under the ARPL. See LICENSE for details. -menuentry "FrenchToastOS" { +menuentry "FrenchToastOS (UEFI)" { + set gfxmode=auto + insmod efi_gop + insmod efi_uga + insmod all_video + insmod multiboot + multiboot /boot/FrenchToastOS.bin + boot +} + +menuentry "FrenchToastOS (BIOS)" { + # in BIOS we can do as much arbitrary stuff as we want so just set the one we wanted set gfxmode=1024x768x32 insmod multiboot multiboot /boot/FrenchToastOS.bin + boot } diff --git a/install-deps-alpine.sh b/install-deps-alpine.sh deleted file mode 100755 index 52f842c..0000000 --- a/install-deps-alpine.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/ash - -# Copyright (c) 2026 Arslaan Pathan -# This software is licensed under the ARPL. See LICENSE for details. - -apk add grub grub-bios gcc-i386-elf binutils-i386-elf make xorriso diff --git a/run-docker.sh b/run-docker.sh deleted file mode 100755 index bafba09..0000000 --- a/run-docker.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# Copyright (c) 2026 Arslaan Pathan -# This software is licensed under the ARPL. See LICENSE for details. - -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 @@ -11,6 +11,8 @@ This software is licensed under the ARPL. See LICENSE for details. */ /* ask grub for framebuffer if this breaks the OS i might crash out */ +/* THIS IS NOT GUARANTEED 1024x768x32!!!!! + VIDEO MODE **CAN** AND MOST LIKELY WILL CHANGE ON OTHER SYSTEMS!! */ .set WIDTH, 1024 .set HEIGHT, 768 .set DEPTH, 32 |
