Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

threading, memory management added #6

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
RedCube OS (0.1)

After some long break, I am back!!
Did some code cleanup and wrote a "protos.h" file which was really needed.
Now some compiler warnings are still there, but this is a new start!

-- Stefan Pietzonke <jay-t@gmx.net> Mon Nov 23 2020 20:20 +0100
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
mkeykernel
mkeykernel fork
=======

I forked mkeykernel.
I added the following things:

- Frame buffer text scrolling, removes the top line on screen if reached last line on print
- kprint_int () function to print integer numbers.
- library with a few new functions
- ksh a kernel shell
- multithreading, code taken from a workshop and modified to fit.
- thread priority settings, see multithread demo.
- make.sh and run.sh scripts:
make.sh compiles the kernel and creates an .iso file.
run.sh runs bochs with the created .iso file and starts the kernel


I will try to continue work on this kernel.

Stefan Pietzonke 2017



This is a kernel that can read the characters a-z and 0-9 from the keyboard and print them on screen.

See the repo [mkernel](http://github.com/arjun024/mkernel) which is a minimal kernel that prints a string on the screen. mkeykernel just extends this to include keyboard support.
Expand Down
Binary file removed binary_x86/kernel
Binary file not shown.
9 changes: 9 additions & 0 deletions bochsrc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
megs: 512
display_library: sdl2
romimage: file=/usr/share/bochs/BIOS-bochs-latest
vgaromimage: file=/usr/share/bochs/VGABIOS-lgpl-latest
ata0-master: type=cdrom, path=os.iso, status=inserted
boot: cdrom
log: bochslog.txt
clock: sync=realtime, time0=local
cpu: count=1, ips=1000000
51 changes: 0 additions & 51 deletions kernel.asm

This file was deleted.

163 changes: 0 additions & 163 deletions kernel.c

This file was deleted.

44 changes: 0 additions & 44 deletions keyboard_map.h

This file was deleted.

42 changes: 42 additions & 0 deletions make-clang.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash
cd src/kernel

rm *.o
nasm -f elf32 kernel.asm -o kasm.o
nasm -f elf32 threadS.asm -o threadS.o
nasm -f elf32 interruptStubs.asm -o interruptStubs.o
clang -m32 -c kernel.c -o kc.o
clang -m32 -c io.c -o io.o
clang -m32 -c lib.c -o lib.o
clang -m32 -c gdt.c -o gdt.o
clang -m32 -c physmem.c -o physmem.o
clang -m32 -c thread.c -o thread.o
clang -m32 -c interrupts.c -o interrupts.o
clang -m32 -c idt.c -o idt.o
clang -m32 -c pit.c -o pit.o
clang -m32 -c pic.c -o pic.o
clang -m32 -c message.c -o message.o
clang -m32 -c syscall.c -o syscall.o

ld -m elf_i386 -T link.ld -o kernel kasm.o kc.o io.o lib.o gdt.o physmem.o thread.o threadS.o interrupts.o interruptStubs.o idt.o pit.o pic.o message.o syscall.o

echo "kernel build end, making .iso"

# make iso
cd ../../
rm os.iso
mkdir -p iso/boot/grub # create the folder structure
cp stage2_eltorito iso/boot/grub/ # copy the bootloader
cp menu.lst iso/boot/grub/ # copy menu
cp src/kernel/kernel iso/boot/ # copy the kernel
cp src/user/test.bin iso/
genisoimage -R \
-b boot/grub/stage2_eltorito \
-no-emul-boot \
-boot-load-size 4 \
-A os \
-input-charset utf8 \
-quiet \
-boot-info-table \
-o os.iso \
iso
42 changes: 42 additions & 0 deletions make.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash
cd src/kernel

rm *.o
nasm -f elf32 kernel.asm -o kasm.o
nasm -f elf32 threadS.asm -o threadS.o
nasm -f elf32 interruptStubs.asm -o interruptStubs.o
gcc -m32 -c kernel.c -o kc.o
gcc -m32 -c io.c -o io.o
gcc -m32 -c lib.c -o lib.o
gcc -m32 -c gdt.c -o gdt.o
gcc -m32 -c physmem.c -o physmem.o
gcc -m32 -c thread.c -o thread.o
gcc -m32 -c interrupts.c -o interrupts.o
gcc -m32 -c idt.c -o idt.o
gcc -m32 -c pit.c -o pit.o
gcc -m32 -c pic.c -o pic.o
gcc -m32 -c message.c -o message.o
gcc -m32 -c syscall.c -o syscall.o

ld -m elf_i386 -T link.ld -o kernel kasm.o kc.o io.o lib.o gdt.o physmem.o thread.o threadS.o interrupts.o interruptStubs.o idt.o pit.o pic.o message.o syscall.o

echo "kernel build end, making .iso"

# make iso
cd ../../
rm os.iso
mkdir -p iso/boot/grub # create the folder structure
cp stage2_eltorito iso/boot/grub/ # copy the bootloader
cp menu.lst iso/boot/grub/ # copy menu
cp src/kernel/kernel iso/boot/ # copy the kernel
cp src/user/test.bin iso/
genisoimage -R \
-b boot/grub/stage2_eltorito \
-no-emul-boot \
-boot-load-size 4 \
-A os \
-input-charset utf8 \
-quiet \
-boot-info-table \
-o os.iso \
iso
Loading