diff options
| -rw-r--r-- | .gitignore | 5 | ||||
| -rw-r--r-- | LICENSE | 27 | ||||
| -rw-r--r-- | boot/grub.cfg | 3 | ||||
| -rwxr-xr-x | install-deps-alpine.sh | 3 | ||||
| -rw-r--r-- | linker.ld | 3 | ||||
| -rwxr-xr-x | run-docker.sh | 5 | ||||
| -rw-r--r-- | src/boot.s | 5 | ||||
| -rw-r--r-- | src/kernel.c | 15 |
8 files changed, 62 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c8140ed --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +src/boot.o +src/kernel.o +*.iso +FrenchToastOS.bin +isodir @@ -0,0 +1,27 @@ +Arslaan Pathan License (ARPL) +Version 1.0, March 1st 2026 + +Copyright (c) 2026 Arslaan Pathan +Everyone is permitted to copy and distribute verbatim copies of this document, but changing it is not allowed. + +You are free to: +- Use, modify, copy, and distribute this software for any purpose, including commercially. + +Under the following conditions: +1. Attribution: You must credit the original author(s) clearly in your project. For command-line tools, this can be in --version or --credits output. For commercial products, this must appear somewhere reasonably visible. + +2. Copyleft: If you distribute a modified version of this software, the source code must be publicly available and licensed under the ARPL v1.0. You may not relicense it. + +3. Modified notice: If you distribute a modified version of this software, you must clearly state that it has been modified from the original somewhere reasonably visible, for example, your README or documentation. You are not obligated to list every change. + +4. No endorsement: You may not claim that your project(s) are endorsed, sponsored, or approved by the original author(s) without explicit written permission. + +5. No additional restrictions: You may not add any further restrictions beyond what this license requires. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-- +To apply the ARPL to your projects, add a LICENSE file with this text in the root of your project, and append the following header as a comment to the top of each source file: + +Copyright (c) [year] [copyright holders] +This software is licensed under the ARPL. See LICENSE for details. diff --git a/boot/grub.cfg b/boot/grub.cfg index 206459c..05aa62e 100644 --- a/boot/grub.cfg +++ b/boot/grub.cfg @@ -1,3 +1,6 @@ +# Copyright (c) 2026 Arslaan Pathan +# This software is licensed under the ARPL. See LICENSE for details. + menuentry "FrenchToastOS" { multiboot /boot/FrenchToastOS.bin } diff --git a/install-deps-alpine.sh b/install-deps-alpine.sh index 1a91ed1..52f842c 100755 --- a/install-deps-alpine.sh +++ b/install-deps-alpine.sh @@ -1,3 +1,6 @@ #!/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 @@ -1,3 +1,6 @@ +/* Copyright (c) 2026 Arslaan Pathan +This software is licensed under the ARPL. See LICENSE for details. */ + ENTRY(_start) SECTIONS diff --git a/run-docker.sh b/run-docker.sh index f4093d2..bafba09 100755 --- a/run-docker.sh +++ b/run-docker.sh @@ -1,6 +1,9 @@ #!/bin/sh -echo "installing binfmt hooks because alarm is bad and it keeps breaking on reboot" +# 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 @@ -1,3 +1,6 @@ +/* Copyright (c) 2026 Arslaan Pathan +This software is licensed under the ARPL. See LICENSE for details. */ + /* Multiboot header dark magic, do not touch */ .set ALIGN, 1<<0 .set MEMINFO, 1<<1 @@ -34,7 +37,7 @@ _start: /* here we need to init crucial processor state. load the gdt, enable pages, init isa extensions/floating point instructions and stuff - for now just dont do anything we'll add that later */ + for now just dont do anything we'll add that later(TM) */ /* enter the high level kernel ABI says we need 16-byte alignment here, we aligned that before and pushed a multiple of 16 bits (zero) so we fine diff --git a/src/kernel.c b/src/kernel.c index eb5ac45..ae50def 100644 --- a/src/kernel.c +++ b/src/kernel.c @@ -1,3 +1,6 @@ +/* Copyright (c) 2026 Arslaan Pathan +This software is licensed under the ARPL. See LICENSE for details. */ + #include <stdbool.h> #include <stddef.h> #include <stdint.h> @@ -9,7 +12,7 @@ /* This operating system will only work for the 32-bit ix86 targets. */ #if !defined(__i386__) -#error "This tutorial needs to be compiled with a ix86-elf compiler" +#error "this operating system needs to be compiled with a ix86-elf compiler" #endif /* Hardware text mode color constants. */ @@ -86,7 +89,14 @@ void terminal_putentryat(char c, uint8_t color, size_t x, size_t y) void terminal_putchar(char c) { + if (c == '\n') { + terminal_column = 0; + ++terminal_row; + return; + } + terminal_putentryat(c, terminal_color, terminal_column, terminal_row); + if (++terminal_column == VGA_WIDTH) { terminal_column = 0; if (++terminal_row == VGA_HEIGHT) @@ -110,7 +120,8 @@ void kernel_main(void) /* Initialize terminal interface */ terminal_initialize(); - terminal_writestring("Hello, kernel World!\n"); + terminal_writestring("loading FrenchToastOS...\n"); + terminal_writestring("developed by Arslaan Pathan"); while (1) { __asm__ __volatile__ ("hlt"); |
