Skip to content

Commit 3a9accc

Browse files
committed
Major update
* Fixed a bug in PMM * Implemented function to retrieve cpuinfo * Implemented a driver for keyboard * Implemented a new shell * Removed debug symbol support * Added a new data structure 'list' * Implemented a new Pseudorandom number generator * Added new string operators * Updated link.ld * Fixed all warnings except one in serial.c * Added a function to read timestamp counter * Added a function to measure cpu clock speed * Updated textmode driver * Updated Makefile * Incremented kernel version * Implemented a function to dump contents of a memory address to screen or serial port
1 parent a648544 commit 3a9accc

36 files changed

+1389
-406
lines changed

Makefile

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ GRUBDIR=
66
SCRIPTSDIR=$(SRCDIR)/scripts/
77

88
CC=$(TOOLDIR)/i686-elf-gcc
9-
CFLAGS= -I$(INCLUDEDIR) -I/usr/include -nostdlib -lgcc -fno-builtin -fno-exceptions -fno-leading-underscore -Wno-write-strings -m32 -g
9+
CFLAGS= -I$(INCLUDEDIR) -I/usr/include -nostdlib -lgcc -fno-builtin -fno-exceptions -fno-leading-underscore -Wall -m32 -g
1010

1111
CXX=$(TOOLDIR)/i686-elf-g++
1212
CXXFLAGS=
@@ -27,8 +27,8 @@ OBJDUMP = i686-elf-objdump
2727
OBJCOPYFLAGS = --strip-debug --strip-unneeded
2828

2929
QEMU=qemu-system-i386
30-
QEMUFLAGS=-cdrom SEOS.iso
31-
QEMUDFLAGS=-serial file:serial.log -s -S -daemonize
30+
QEMUFLAGS=-cdrom SEOS.iso -m 1024M
31+
QEMUDFLAGS=-serial file:serial.log -s -S -daemonize -m 32M
3232

3333
PROJECT=SEOS
3434

@@ -45,6 +45,8 @@ OBJECTS= $(SRCDIR)/boot/multiboot.o \
4545
$(SRCDIR)/drivers/cpu/idt_helper.o \
4646
$(SRCDIR)/drivers/cpu/pic.o \
4747
$(SRCDIR)/drivers/cpu/pit.o \
48+
$(SRCDIR)/drivers/cpu/rdtsc.o \
49+
$(SRCDIR)/drivers/cpu/cpuinfo.o \
4850
$(SRCDIR)/interrupts/interrupt.o \
4951
$(SRCDIR)/interrupts/interrupt_helper.o \
5052
$(SRCDIR)/interrupts/exception.o \
@@ -53,35 +55,29 @@ OBJECTS= $(SRCDIR)/boot/multiboot.o \
5355
$(SRCDIR)/common/libs/string.o \
5456
$(SRCDIR)/common/libs/printf.o \
5557
$(SRCDIR)/common/libs/bit.o \
56-
$(SRCDIR)/common/libs/symbols.o \
57-
$(SRCDIR)/common/libs/sym.o \
58+
$(SRCDIR)/common/libs/math.o \
59+
$(SRCDIR)/common/libs/rng.o \
60+
$(SRCDIR)/common/libs/list.o \
5861
$(SRCDIR)/drivers/video/vga_text.o \
5962
$(SRCDIR)/drivers/io/serial.o \
63+
$(SRCDIR)/drivers/input/keyboard.o \
6064
$(SRCDIR)/memory/kheap.o \
6165
$(SRCDIR)/memory/paging.o \
6266
$(SRCDIR)/memory/pmm.o \
67+
$(SRCDIR)/kernel/shell.o \
6368
$(SRCDIR)/kernel/kernel.o
6469

6570
all: kernel iso
6671

6772
kernel: $(EXECUTABLE)
6873
iso: $(ISOFILE)
6974

70-
$(EXECUTABLE): get_symboltable $(OBJECTS)
75+
$(EXECUTABLE): $(OBJECTS)
7176
@echo '[LD] $@'
7277
@$(LD) $(LDFLAGS) -o $@ $(OBJECTS)
7378

7479
compile_objs: $(OBJECTS)
7580

76-
kernel2:
77-
@make get_symboltable
78-
@make compile_objs
79-
@echo '[LD] $(EXECUTABLE)'
80-
@$(LD) $(LDFLAGS) -o $(EXECUTABLE) $(OBJECTS)
81-
82-
83-
truecompile: clean kernel2 clean_objs kernel2 iso
84-
8581
$(ISOFILE): $(EXECUTABLE)
8682
@echo '[GRUB] $@'
8783
@mkdir -p $(PROJECT)/boot/grub
@@ -110,10 +106,10 @@ $(ISOFILE): $(EXECUTABLE)
110106
@echo '[NASM] $@'
111107
@$(NASM) $(NASMFLAGS) -o $@ $<
112108

113-
run: truecompile
109+
run: $(ISOFILE)
114110
$(QEMU) $(QEMUFLAGS)
115111

116-
rund: truecompile
112+
rund: $(ISOFILE)
117113
$(QEMU) $(QEMUFLAGS) $(QEMUDFLAGS)
118114

119115
stripd: $(EXECUTABLE)
@@ -123,9 +119,6 @@ stripd: $(EXECUTABLE)
123119
forcerun: clean iso run
124120
forcerund: clean iso rund
125121

126-
get_symboltable:
127-
$(SCRIPTSDIR)/get_symbols.sh $(EXECUTABLE) > $(SRCDIR)/common/libs/symbols.c
128-
129122
PHONY: clean kernel
130123
clean:
131124
@echo 'Cleaning the source directory...'

docs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
<h1 align="CENTER">SectorOS-RW4</h1>
77

88
<p align="CENTER">
9-
SectorOS-RW4 is a rewrite 4 operating system project, currently in progress. This README file provides important information about the project, including how to build and run it.
9+
SectorOS-RW4 is the 4th rewrite of SectorOS project, currently in progress. This README file provides important information about the project, including how to build and run it.
1010
Kernel Version
1111
</p>
1212
<hr>
1313
<br>
1414

1515

1616
## 🧱 Kernel
17-
The current kernel version for SectorOS-RW4 is v2.23.03.7NR.<br>
17+
The current kernel version for SectorOS-RW4 is v3.23.03.8NR.<br>
1818

1919
## ⚙️ Build Steps
2020

docs/bochsrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
megs: 32
2+
ata0-slave: type=cdrom, path=SEOS.iso, status=inserted
3+
com1: enabled=1, mode=file, dev=serial.log
4+
speaker: enabled=1, mode=sound
5+
boot: cdrom
6+
mouse: enabled=0
7+
clock: sync=realtime
8+
cpu: ips=500000000
9+
display_library: x, options="gui_debug"

docs/changelog.txt

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,23 @@
8181
* Added new script get_symbols.sh to get symbols from the kernel and put them into symbols.c
8282
* Updated kernel.c
8383
* Incremented kernel version
84-
* Updated README.md
84+
* Updated README.md
85+
86+
03-04-2023: 02:23 PM IST v3.23.03.8NR
87+
* Major update
88+
* Fixed a bug in PMM
89+
* Implemented function to retrieve cpuinfo
90+
* Implemented a driver for keyboard
91+
* Implemented a new shell
92+
* Removed debug symbol support
93+
* Added a new data structure 'list'
94+
* Implemented a new Pseudorandom number generator
95+
* Added new string operators
96+
* Updated link.ld
97+
* Fixed all warnings except one in serial.c
98+
* Added a function to read timestamp counter
99+
* Added a function to measure cpu clock speed
100+
* Updated textmode driver
101+
* Updated Makefile
102+
* Incremented kernel version
103+
* Implemented a function to dump contents of a memory address to screen or serial port

src/backup/symbols.c

Lines changed: 0 additions & 126 deletions
This file was deleted.

src/boot/link.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ vaddr = off + paddr;
66

77
SECTIONS
88
{
9-
. = 0xC0100000;
9+
. = vaddr;
1010
.text ALIGN(4K) : AT(ADDR(.text)-0xC0000000)
1111
{
1212
*(.multiboot)

src/boot/multiboot.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
.align 4
1010
.long MAGIC
1111
.long FLAGS
12-
.long CHECKSUM
12+
.long CHECKSUM

0 commit comments

Comments
 (0)