Add: build process for real hardware
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -2,3 +2,6 @@
|
||||
bochslog.txt
|
||||
build/
|
||||
kernel.elf
|
||||
os.iso
|
||||
blankos.iso
|
||||
real/
|
||||
|
||||
17
README.md
17
README.md
@@ -39,6 +39,21 @@ make run
|
||||
|
||||
This will start a new Bochs debugger instance. To proceed with the kernel execution, you will have to type `c` in the shell spawning Bochs. Serial output will be saved under the `com1.out` file, this way you can debug the kernel by viewing its log messages. To quit, type `q`. Feel free to open issues or pull requests.
|
||||
|
||||
## Running on real hardware
|
||||
|
||||
To run the OS on real hardware, you'll first need to have a BIOS-compatible computer. Some of the new laptops with graphical "BIOSes" only support UEFI now. So make sure to get a computer that can boot into BIOS mode, **not UEFI mode**. Then, switch the boot mode to "Legacy" in your BIOS utility.
|
||||
|
||||
Then, use the Makefile target `real` to build a "real"-capable ISO disk image. The image will have GRUB2 installed on it, using the `grub-mkrescue` utility (make sure to install it before) which is dependent on `xorriso` (install it too).
|
||||
|
||||
Once the ISO file is generated, you can write it on a disk using this command:
|
||||
|
||||
```
|
||||
sudo dd bs=4M if=blankos.iso of=/dev/sdX status=progress oflag=sync
|
||||
```
|
||||
|
||||
Replace `sdX` with your USB drive name (you can find it by doing `sudo fdisk -l`).
|
||||
Tada! You now have a working BlankOS USB stick. Go ahead and try it out!
|
||||
|
||||
### ⚠️ Disclaimer
|
||||
|
||||
This is a hobbyist operating system kernel and it comes without any warranty whatsoever! It isn't capable of anything really.
|
||||
This is a hobbyist operating system kernel and it comes without any warranty whatsoever! It isn't capable of anything really. Feedback and contributions are highly appreciated!
|
||||
|
||||
Binary file not shown.
9
makefile
9
makefile
@@ -1,5 +1,5 @@
|
||||
CC = gcc
|
||||
CFLAGS = -m32 -nostdlib -nostdinc -fno-builtin -fno-stack-protector -nostartfiles -nodefaultlibs -Wall -Wextra -c -I src/
|
||||
CFLAGS = -m32 -nostdlib -nostdinc -fno-builtin -fno-stack-protector -nostartfiles -nodefaultlibs -Wall -Wextra -Wno-div-by-zero -c -I src/
|
||||
LDFLAGS = -T link.ld -melf_i386
|
||||
AS = nasm
|
||||
ASFLAGS = -f elf
|
||||
@@ -43,9 +43,14 @@ os.iso: kernel.elf
|
||||
-o os.iso \
|
||||
iso
|
||||
|
||||
real: kernel.elf
|
||||
mkdir -p real/boot/grub
|
||||
cp kernel.elf real/boot/kernel.elf
|
||||
grub-mkrescue real -o blankos.iso
|
||||
|
||||
run: os.iso
|
||||
bochs -f bochsrc.txt -q
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJ_DIR) kernel.elf os.iso
|
||||
rm -rf $(OBJ_DIR) kernel.elf os.iso blankos.iso real
|
||||
|
||||
|
||||
@@ -17,8 +17,12 @@ void shell_install()
|
||||
|
||||
if (strcmp(input_buffer, "help") == 0)
|
||||
{
|
||||
printf("This is the Blank Operating System\ndesigned for fun by xamidev\n\nCommand help:\n\n\thelp - shows this message\n");
|
||||
printf("This is the Blank Operating System\ndesigned for fun by xamidev\n\nCommand help:\n\n\thelp - shows this message\n\tpanic - makes the kernel panic\n");
|
||||
}
|
||||
else if (strcmp(input_buffer, "panic") == 0)
|
||||
{
|
||||
printf("%d", 4/0);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user