Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
48efc0e
restarting the project
zeb33n Dec 18, 2024
fd1108a
lets be carful we dont overwrite the buffer lololo
zeb33n Dec 18, 2024
6d5e04e
nice changes
zeb33n Dec 18, 2024
0721d3b
getting there with the stack
zeb33n Dec 18, 2024
52c0805
nice changes
zeb33n Dec 19, 2024
462add5
welcome to zeb os
zeb33n Dec 19, 2024
9af1bb4
added proper boot loader
zeb33n Dec 19, 2024
3f4a751
added function to write anywhere on the screen
zeb33n Dec 19, 2024
d303214
added printing for numbers
zeb33n Dec 20, 2024
d9b2d63
added base x printing
zeb33n Dec 21, 2024
9d72e73
nice changes
zeb33n Dec 22, 2024
5e3a3e0
added links
zeb33n Dec 22, 2024
121f4ad
file reorganisation
zeb33n Dec 22, 2024
85fc72f
idt loaded
zeb33n Dec 22, 2024
c346d4f
attempt to debug looks like the kernel is overwriting .bss or somethi…
zeb33n Dec 23, 2024
e581ff2
working interrupts
zeb33n Dec 23, 2024
60120bd
improved printing
zeb-smells Dec 28, 2024
9d18a95
added logo
zeb-smells Dec 28, 2024
09f9e73
tweaked printing
zeb-smells Dec 30, 2024
e67796e
added scrolling to vga drivers
zeb-smells Dec 30, 2024
f9da92b
keyboard irqs hell yeah
zeb-smells Dec 31, 2024
86de9ff
added a lot of keys
zeb-smells Dec 31, 2024
6588d49
added cursor movement
zeb-smells Dec 31, 2024
688c683
added gitginore
zeb-smells Dec 31, 2024
2baa523
added some bits
zeb-smells Jan 1, 2025
9b5685a
added stuff
zeb33n Jan 2, 2025
d078ce4
refactored keyboard driver to use a lookup tables
zeb33n Jan 2, 2025
ee37280
refactored slightley
zeb33n Jan 2, 2025
3ae0e33
added stdin buffer
zeb33n Jan 3, 2025
1f54cbf
added echo shell
zeb33n Jan 3, 2025
1fbeb1c
optimisations and tidying
zeb33n Jan 3, 2025
919baf8
?
zeb33n Jan 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/Binaries
47 changes: 0 additions & 47 deletions boot.asm

This file was deleted.

Binary file removed boot.bin
Binary file not shown.
21 changes: 0 additions & 21 deletions bootBuffer.asm

This file was deleted.

17 changes: 0 additions & 17 deletions boot_0.asm

This file was deleted.

50 changes: 50 additions & 0 deletions buildcrosscompiler.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# nasm and qemu
sudo dnf install nasm
sudo dnf install qemu
sudo dnf install qemu-kvm

# GCC cross compiler for i386 systems (might take quite some time, prepare food)

sudo dnf update
sudo dnf install gcc gcc-c++ make
sudo dnf install bison
sudo dnf install flex
sudo dnf install libgmp3-devel
sudo dnf install libmpc-devel
sudo dnf install libmpfr-devel
sudo dnf install texinfo

#cURL (needed to clone some required files)
sudo dnf install curl

export PREFIX="/usr/local/i386elfgcc"
export TARGET=i386-elf
export PATH="$PREFIX/bin:$PATH"

mkdir /tmp/src
cd /tmp/src
curl -O http://ftp.gnu.org/gnu/binutils/binutils-2.39.tar.gz
tar xf binutils-2.39.tar.gz
mkdir binutils-build
cd binutils-build
../binutils-2.39/configure --target=$TARGET --enable-interwork --enable-multilib --disable-nls --disable-werror --prefix=$PREFIX 2>&1 | tee configure.log
sudo make all install 2>&1 | tee make.log

cd /tmp/src
curl -O https://ftp.gnu.org/gnu/gcc/gcc-12.2.0/gcc-12.2.0.tar.gz
tar xf gcc-12.2.0.tar.gz
mkdir gcc-build
cd gcc-build
echo Configure: . . . . . . .
../gcc-12.2.0/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --disable-libssp --enable-language=c,c++ --without-headers
echo MAKE ALL-GCC:
sudo make all-gcc
echo MAKE ALL-TARGET-LIBGCC:
sudo make all-target-libgcc
echo MAKE INSTALL-GCC:
sudo make install-gcc
echo MAKE INSTALL-TARGET-LIBGCC:
sudo make install-target-libgcc
echo HERE U GO MAYBE:
ls /usr/local/i386elfgcc/bin
export PATH="$PATH:/usr/local/i386elfgcc/bin"
33 changes: 0 additions & 33 deletions ourSolution.asm

This file was deleted.

Empty file removed pchar.bin
Empty file.
136 changes: 136 additions & 0 deletions src/bootloader/boot.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
[org 0x7c00] ; start of data segment
KERNEL_LOCATION equ 0x1000


mov [BOOT_DISK], dl


xor ax, ax ;starting at 0x0
mov es, ax
mov ds, ax
mov bp, 0x8000
mov sp, bp

mov bx, KERNEL_LOCATION ; we want to load the kwrnwl to the kernel location
mov dh, 20 ;might have to change this number. number of sectors to read

mov ah, 0x02
mov al, dh ; number of sectors
mov ch, 0x00
mov dh, 0x00
mov cl, 0x02
mov dl, [BOOT_DISK]
int 0x13 ;load from disk

; error managment
jc error ; jump if carry flag is set
cmp al, 2
jne error

jmp endload


error:
mov ah, 0x0e
mov bx, errorMsg

eloop:
mov al, [bx]
cmp al, 0
je endload
int 0x10
inc bx
jmp eloop

endload:

mov ah, 0x0
mov al, 0x3
int 0x10 ; text mode


CODE_SEG equ GDT_code - GDT_start
DATA_SEG equ GDT_data - GDT_start

cli
lgdt [GDT_descriptor]
mov eax, cr0
or eax, 1
mov cr0, eax
jmp CODE_SEG:start_protected_mode

jmp $

errorMsg:
db "error", 0

BOOT_DISK: db 0

GDT_start:
GDT_null:
dd 0x0 ; we get 4gb of memory in protected mode
dd 0x0 ; flat memory model

GDT_code:
dw 0xffff ; we only define the first 16bits of the limit the real value is 0xfffff
dw 0x0 ; we multiply this value by 0x1000 as described in the flags
db 0x0
db 0b10011010
db 0b11001111 ; the last 4 bits of the limit are described here 0b1111
db 0x0

GDT_data:
dw 0xffff
dw 0x0
db 0x0
db 0b10010010
db 0b11001111
db 0x0

GDT_end:

GDT_descriptor:
dw GDT_end - GDT_start - 1
dd GDT_start

; need to refactor this file
; load the idtp

[bits 32]
start_protected_mode:
mov ax, DATA_SEG ;segment registers ; the value is 16
mov ds, ax ;data segment
mov ss, ax ;stack segment
mov es, ax ;extra segments
mov fs, ax
mov gs, ax

mov ebp, 0x90000 ; 32 bit stack base pointer
mov esp, ebp

; ; print digit
; mov ax, ax
; mov ecx, 0xb8000 ;print digit
; print_dec:
; xor dx, dx
; mov bx, 10
; div bx ; remainder goes to dx

; xor ah, ah

; mov bl, dl
; add bl, 0x30
; mov bh, 0x07
; mov [ecx], bx

; add ecx, 2
; cmp ax, 0
; jne print_dec


jmp KERNEL_LOCATION



times 510-($-$$) db 0
dw 0xaa55
5 changes: 5 additions & 0 deletions src/bootloader/kernel_entry.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
section .text
[bits 32]
[extern _start]
call _start
jmp $
1 change: 1 addition & 0 deletions src/bootloader/zeroes.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
times 10240 db 0
Loading