Skip to content

kln-old/MyKernel

Repository files navigation

MyKernel:
==========

This is just a hobby kernel which i'm developing to better understand my knowledge of kernels, bootloaders and other operating system features.
This is based on James kernel development tutorial, in addition to my own code and design. 
The developemet is currently being performed out on an X86 machine in my free time.

The testing is done using 'bochs'[http://bochs.sourceforge.net/]


How to use:
===========

$cd MyKernel
$cd src
$make					#compile the source files
$cd ..
$./update_image.sh		#update or create the floppy.img
$./run_bochs.sh			#loads floppy.img and starts bochs


bootable usb!!
==============
$ dd if=./floppy.img of=/dev/sdb	#where /dev/sdb is your usb drive. will get screwed up if not careful.


Directory Structure:
====================

MyKernel/: [root dir]
=========
|
+-----bochsout.txt: output generated by bochs. used for debugging pruposes.
|
+-----bochsrc.txt: configuration file for bochs.
|
+-----floppy.img: floppy image of the kernel generated from src/kernel .
|
+-----kernel.txt: set of ascii art for 'kernel' which i used for the boot screen.
|
+-----kln.txt: set of ascii art of my coding signature 'kln' which i intendt to use sometime later.
|
+-----run_bochs.sh: a simple script that loads the floppy.img and starts bochs
|
+-----update_image.sh: a simple script that updates & creates the floppy.img from src/kernel binary.
|
+--src/: [contains all the source files]
   ====
   |
   +----boot.s: start of the kernel. contais the multiboot header, a lil bit of initializatio and calls 'main'.
   |
   +----common.c | .h : contains some of the commonly used very inline assembly routines and commonly used typedefs.
   |
   +----descriptor_tables.c | .h : functions to initialize GDT & IDT and defines ISR and IRQ handler.
   |
   +----gdt.s : global descriptor table and interrupt descriptor table setup code.
   |
   +----interrupt.s : interrrupt service routine wrappers
   |
   +----isr.c | .h : high level interrupt service routines and interrupt request handlers
   |
   +----kdb.c | .h : keyboard driver and keymaps
   |
   +----kernel : compiled elf-32bit executable kernel.
   |
   +----link.ld : instructions for the 'ld' linker
   |
   +----main.c :entry point of the kernel.contains the main routine called by boot.s
   |
   +----monitor.c | .h :[experimental] old files containng the display routines. screen.c contains all the updated and additional code.just kept it incase i need it sometime later
   |
   +----newkdb.c : [experimental] started this to try out something new for the keyboard driver.
   |
   +----screen.c | .h : contains the structues and routines to write to the display screen. Also contains the basic routines to initialize and draw windows on screen.
   |
   +----string.c | .h : basic routines for string manipulation.
   |
   +----terminal.c | .h : [experimental] routines for a simple simulation of the terminal
   |
   +----test.h : header file for testing purposes.
   |
   +----timer.c | .h : routines for controlling the system timer. provides basic sleep functions
   |
   +----winman.c | .h : [experimental] supposed to be the windows manager.


Problems:
==========
1. 	If bios does not detect the usb as a bootable device, then you'l have to instruct the bios to treat the usb as a floppy, cause we are using the floppy image structure.
	The exact steps to do this changes from one bios to another, but it should be easy to find out if you explore a bit.

2.	If bochs does not load properly, then make sure that your bochsrc.txt file contains the appropriate path for the rom images. i'm using address=0x000000, if it doesnot
	work for you, then try address=0xf00000. read the bochs manual to know more about bochs configuration.

3. i'm using /mnt2 and /dev/loop0. make sure you have the same or make appropriate changes in bochsrc.txt, update_image.sh and run_bochs.sh




About

just a simple hobby kernel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published