Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Operating_System
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hazal2.Veziroglu@live.uwe.ac.uk
Operating_System
Commits
6f9082e7
Commit
6f9082e7
authored
5 months ago
by
Hazal2.Veziroglu@live.uwe.ac.uk
Browse files
Options
Downloads
Patches
Plain Diff
Update file README.md
parent
0ddbe3a9
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tiny-os/README.md
+92
-1
92 additions, 1 deletion
tiny-os/README.md
with
92 additions
and
1 deletion
tiny-os/README.md
+
92
−
1
View file @
6f9082e7
...
@@ -46,4 +46,95 @@ Key features of this project include:
...
@@ -46,4 +46,95 @@ Key features of this project include:
1. Bootloader:
1. Bootloader:
- GRUB is used to load the kernel.
- GRUB is used to load the kernel.
- The kernel starts execution at the entry point defined in loader.asm.
- The kernel starts execution at the entry point defined in loader.asm.
2. Transition to C:
- The kernel successfully calls and executes functions implemented in kernel.c.
3.Framebuffer Driver:
- Implements the following functions:
-fb_clear(): Clears the screen.
-fb_print(): Prints text at specified row and column.
-fb_move(): Moves the cursor to a specific position.
4.QEMU Testing:
-The OS is tested using QEMU in graphical and curses modes.
---
## **4. Implementation Details**
Bootloader (loader.asm)
The bootloader adheres to the Multiboot specification and transfers control to the kernel:
```
asm
global loader
extern kernel_main
section .text
align 4
MAGIC_NUMBER equ 0x1BADB002
FLAGS equ 0x0
CHECKSUM equ -MAGIC_NUMBER
dd MAGIC_NUMBER
dd FLAGS
dd CHECKSUM
loader:
call kernel_main
hlt
```
Kernel (kernel.c)
The kernel initializes the framebuffer and tests its driver:
```
c
#include "fb.h"
void kernel_main() {
fb_clear();
fb_print("Sum: 6", 0, 0);
fb_print("Booting Tiny OS", 1, 0);
fb_move(2, 0);
while (1) {}
}
```
Framebuffer Driver (fb.c)
Implements APIs for interacting with the framebuffer:
```
c
#include "fb.h"
#include "io.h"
void fb_clear() {
char
*fb = (char *
)0xB8000;
for (int i = 0; i < 80
*
25; i++) {
fb[i
*
2] = ' ';
fb[i
*
2 + 1] = 0x07;
}
}
void fb_print(const char
*
str, unsigned short row, unsigned short col) {
char
*fb = (char *
)0xB8000;
unsigned short pos = (row
* 80 + col) *
2;
for (int i = 0; str[i] != '
\0
'; i++) {
fb[pos + i
*
2] = str[i];
fb[pos + i
*
2 + 1] = 0x07;
}
}
void fb_move(unsigned short row, unsigned short col) {
unsigned short pos = row
*
80 + col;
outb(0x3D4, 0x0F);
outb(0x3D5, (unsigned char)(pos & 0xFF));
outb(0x3D4, 0x0E);
outb(0x3D5, (unsigned char)((pos >> 8) & 0xFF));
}
```
---
## **5. Build and Run Instructions**
1. Clean the Build Directory
```
bash
make clean
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment