This may just be a banned torture method... im not sure..

This commit is contained in:
Tyler McGurrin 2025-06-06 16:19:09 -04:00
parent c4c7b881aa
commit 7b3da2b6a5
4 changed files with 34 additions and 24 deletions

View File

@ -1,30 +1,25 @@
include build_scripts/config.mk include build_scripts/config.mk
.PHONY: all floppy_image kernel bootloader clean always tools_fat .PHONY: all floppy_image kernel bootloader clean always
all: image all: kernel
include build_scripts/toolchain.mk include build_scripts/toolchain.mk
# oldnum = cat version
# newnum = expr $(oldnum) + 1
# export oldnum
# export newnum
# #
# Image # Image
# #
image: $(BUILD_DIR)/main.img # image: $(BUILD_DIR)/main.img
$(BUILD_DIR)/main.img: bootloader kernel # $(BUILD_DIR)/main.img: bootloader kernel
dd if=/dev/zero of=$(BUILD_DIR)/main.img bs=512 count=20000 # dd if=/dev/zero of=$(BUILD_DIR)/main.img bs=512 count=20000
mkfs.ext2 $(BUILD_DIR)/main.img # mkfs.ext2 $(BUILD_DIR)/main.img
e2mkdir $(BUILD_DIR)/main.img:boot # e2mkdir $(BUILD_DIR)/main.img:boot
e2mkdir $(BUILD_DIR)/main.img:misc # e2mkdir $(BUILD_DIR)/main.img:misc
e2mkdir $(BUILD_DIR)/main.img:misc/src # e2mkdir $(BUILD_DIR)/main.img:misc/src
e2mkdir $(BUILD_DIR)/main.img:boot/grub # e2mkdir $(BUILD_DIR)/main.img:boot/grub
# e2cp -v -s src/ -d $(BUILD_DIR)/main.img:misc/src really, really, really slow... # e2cp grub/* $(BUILD_DIR)/main.img:boot/grub
e2cp grub/* $(BUILD_DIR)/main.img:boot/grub # mkdir -p $(BUILD_DIR)/mnt
mkdir -p $(BUILD_DIR)/mnt
# #
# Kernel # Kernel

View File

@ -31,22 +31,37 @@ make -s
echo --------- echo ---------
echo Finished! echo Finished!
echo --------- echo ---------
read -p "Do you want to make to make image bootable? [Requires sudo] (y/n) " yn read -p "Do you want to make to make a bootable image? [Requires sudo] (y/n) " yn
case $yn in case $yn in
y) y)
echo ---------------- echo ----------------
echo Installing GRUB! echo Installing GRUB!
echo ---------------- echo ----------------
sudo losetup -d /dev/loop500 sudo losetup -d /dev/loop800
sudo losetup /dev/loop500 build/main.img dd if=/dev/zero of=build/main.img bs=512 count=50000
mkdir -p build/mnt
sudo losetup /dev/loop800 build/main.img
sudo parted /dev/loop800 mktable msdos
sudo parted /dev/loop800 mkpart primary fat16 2048s 100%
sudo parted /dev/loop800p1 set 1 boot on
sudo mkfs.fat -F16 /dev/loop800p1
sudo mount /dev/loop800p1 build/mnt
sudo mkdir build/mnt/boot
sudo mkdir build/mnt/boot/grub
sudo mkdir build/mnt/misc
sudo mkdir build/mnt/misc/src
sudo cp -r src/* build/mnt/src
sudo cp -r grub/* build/mnt/grub
sudo cp build/nanite.bin build/mnt/boot/nanite
sudo grub-install \ sudo grub-install \
--modules="part_msdos" \ --modules="part_msdos" \
--boot-directory=build/mnt/boot \ --boot-directory=build/mnt/boot \
--target=i386-pc \ --target=i386-pc \
--bootloader-id=GRUB \ --bootloader-id=GRUB \
/dev/loop500 -v /dev/loop800 -v
sudo losetup -d /dev/loop500 sudo umount build/mnt
sudo losetup -d /dev/loop800
;; ;;
n ) echo exiting...; n ) echo exiting...;

View File

@ -36,7 +36,7 @@ entry:
cli cli
hlt hlt
section .multiboot_header section .text
header_start: header_start:
dd 0xe85250d6 ; magic number dd 0xe85250d6 ; magic number
dd 0 ; protected mode code dd 0 ; protected mode code

View File

@ -6,4 +6,4 @@
#pragma once #pragma once
#define LOGO " _ _____ _ __________________\n / | / / | / | / / _/_ __/ ____/\n / |/ / /| | / |/ // / / / / __/ \n / /| / ___ |/ /| // / / / / /___ \n/_/ |_/_/ |_/_/ |_/___/ /_/ /_____/ \n" #define LOGO " _ _____ _ __________________\n / | / / | / | / / _/_ __/ ____/\n / |/ / /| | / |/ // / / / / __/ \n / /| / ___ |/ /| // / / / / /___ \n/_/ |_/_/ |_/_/ |_/___/ /_/ /_____/ \n"
#define VERSION "RD-00038" #define VERSION "RD-00039"