Compare commits
2 Commits
2e2693d1ea
...
891085e151
Author | SHA1 | Date | |
---|---|---|---|
891085e151 | |||
364d10d02e |
9
Makefile
9
Makefile
@ -27,7 +27,7 @@ $(BUILD_DIR)/sv-terminal.o \
|
||||
|
||||
|
||||
|
||||
SRC_DIR = src
|
||||
SRC_DIR = source
|
||||
BUILD_DIR = build
|
||||
|
||||
CRTBEGIN_OBJ = $(shell $(CC) $(CFLAGS) -print-file-name=crtbegin.o)
|
||||
@ -50,7 +50,7 @@ clean_iso:
|
||||
iso: clean_iso clean build
|
||||
mkdir -p root/boot/grub
|
||||
cp build/myos.bin root/boot/myos.bin
|
||||
cp src/grub.cfg root/boot/grub/grub.cfg
|
||||
cp source/grub.cfg root/boot/grub/grub.cfg
|
||||
grub-mkrescue -o build/barinkOS.iso root
|
||||
run: all
|
||||
virtualboxvm --startvm "BarinkOS_test"
|
||||
@ -60,9 +60,12 @@ test:
|
||||
|
||||
test_iso:
|
||||
$(EMULATOR) -boot d -cdrom $(BUILD_DIR)/barinkOS.iso -serial stdio -vga std -display gtk -m 2G -cpu core2duo
|
||||
test_disk:
|
||||
$(EMULATOR) -boot d -drive format=raw,file=disk.img -serial stdio -vga std -display gtk -m 2G -cpu core2duo
|
||||
|
||||
|
||||
build_kernel: $(OBJ_LINK_LIST)
|
||||
$(CC) -T $(SRC_DIR)/kernel//linker.ld -o $(BUILD_DIR)/myos.bin \
|
||||
$(CC) -T $(SRC_DIR)/kernel/linker.ld -o $(BUILD_DIR)/myos.bin \
|
||||
-ffreestanding -O2 -nostdlib $(OBJ_LINK_LIST) -lgcc
|
||||
|
||||
build_x86_64:
|
||||
|
25
scripts/build.py
Executable file
25
scripts/build.py
Executable file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/python3
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
|
||||
print("Building BarinkOS")
|
||||
|
||||
|
||||
# list and run build scripts
|
||||
print("Running build-scripts")
|
||||
os.chdir("scripts")
|
||||
|
||||
scripts=os.listdir()
|
||||
currentScript=os.path.basename(__file__)
|
||||
|
||||
if currentScript in scripts:
|
||||
scripts.remove(currentScript)
|
||||
|
||||
|
||||
for script in scripts:
|
||||
print(os.getcwd())
|
||||
print("Running:" + script)
|
||||
subprocess.call(script, cwd=os.getcwd())
|
||||
|
||||
os.chdir("..")
|
64
scripts/create-filesystem.sh
Normal file
64
scripts/create-filesystem.sh
Normal file
@ -0,0 +1,64 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# How to build a boot image
|
||||
# NOTE: This script cant run properly yet
|
||||
# Things described here should be done manually for now
|
||||
#
|
||||
# COPYRIGHT © Nigel Barink 2023
|
||||
#
|
||||
|
||||
echo "Building a FAT16 filesystem"
|
||||
|
||||
|
||||
su
|
||||
|
||||
# dd if=/dev/zero of=diks.img bs=512 count=131072
|
||||
# fdisk disk.img
|
||||
# Use the following options in fdisk (Format Disk Tool)
|
||||
# We want to create a MBR (NOT GPT) Partition table containing 1 logical disk
|
||||
# with a primary FAT16 partition marked bootable
|
||||
|
||||
#OPTIONs
|
||||
|
||||
# Create new DOS disklabel
|
||||
# o
|
||||
# Create new partition
|
||||
# n
|
||||
# Choose Primary as partition type
|
||||
# p
|
||||
# hit enter to choose default for the other options
|
||||
|
||||
# Mark partition 1 as bootable
|
||||
# a
|
||||
|
||||
# Change partition type to FAT16
|
||||
# t
|
||||
# Choose Partition 1
|
||||
# 1
|
||||
# Choose HEX 6 for FAT16
|
||||
# 6
|
||||
|
||||
# Sync and write changes to disk
|
||||
# w
|
||||
|
||||
# Create a "block" device from the disk.img
|
||||
# losetup /dev/loop9 disk.img
|
||||
|
||||
# Format the partition on the disk as FAT16
|
||||
# mkdosfs -F16 /dev/loop9
|
||||
|
||||
# Mount the disk to a folder on our dev machine
|
||||
# mount /dev/loop9 /mnt
|
||||
|
||||
# Install the grub bootloader onto the disk
|
||||
# grub-install --no-floppy --modules="normal multiboot" /dev/loop9 --target=i386-pc --boot-directory=/mnt/boot --force
|
||||
|
||||
# copy the necessary OS files
|
||||
# cp root/boot/myos.bin /mnt/boot/myos.bin
|
||||
# cp root/boot/grub/grub.cfg /mnt/boot/grub/grub.cfg
|
||||
|
||||
# Unmount the device
|
||||
# umount /mnt
|
||||
|
||||
# Destroy the loop device
|
||||
# losetup -d /dev/loop9
|
5
scripts/test.sh
Executable file
5
scripts/test.sh
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
start=`date +%s`
|
||||
end=`date +%s`
|
||||
echo That took $((end-start)) seconds
|
||||
date +"%c" -d195440409
|
@ -21,11 +21,11 @@ stack_bottom:
|
||||
stack_top:
|
||||
|
||||
.section .text
|
||||
.include "./src/kernel/gdt/gdt.s"
|
||||
.include "./src/kernel/irs_table.s"
|
||||
.include "./src/kernel/irq_table.s"
|
||||
.include "./src/kernel/idt/idt.s"
|
||||
.include "./src/kernel/memory/paging.s"
|
||||
.include "./source/kernel/gdt/gdt.s"
|
||||
.include "./source/kernel/irs_table.s"
|
||||
.include "./source/kernel/irq_table.s"
|
||||
.include "./source/kernel/idt/idt.s"
|
||||
.include "./source/kernel/memory/paging.s"
|
||||
|
||||
|
||||
.global _start
|
Loading…
x
Reference in New Issue
Block a user