Principle | Description |
---|---|
Single Responsibility Principle (SRP) | A class should have only one reason to change, or in other words, it should have a single responsibility. |
Open-Closed Principle (OCP) | Software entities should be open for extension, but closed for modification. |
Liskov's Substitution Principle (LSP) | An object of super class can be replaced with an object of a sub class without altering the correctness of the program. |
Interface Segregation Principle (ISP) | Using Many task specific interfaces is better than one general purpose interface |
Dependency Inversion Principle (DIP) | High-level modules should not depend on low-level modules. Both should depend on abstraction. Abstraction should not depend on details. Details should depend on abstraction. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENTRY(loader) /* the name of the entry label */ | |
SECTIONS { | |
. = 0xC0100000; /* the code should be relocated to 3GB + 1 MB */ | |
kernel_virtual_start = .; | |
kernel_physical_start = . - 0xC0000000; | |
/* align at 4 KB and load at 1 MB, AT specifies load address */ | |
.text ALIGN (0x1000) : AT(ADDR(.text)-0xC0000000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OBJECTS = loader.o kmain.o | |
CC = gcc | |
CFLAGS = -m32 -nostdlib -nostdinc -fno-builtin -fno-stack-protector \ | |
-nostartfiles -nodefaultlibs -Wall -Wextra -Werror -c | |
LDFLAGS = -T link.ld -melf_i386 | |
AS = nasm | |
ASFLAGS = -f elf | |
all: kernel.elf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global loader ; the entry symbol for ELF | |
extern sum_of_three | |
MAGIC_NUMBER equ 0x1BADB002 ; define the magic number constant | |
FLAGS equ 0x0 ; multiboot flags | |
CHECKSUM equ -MAGIC_NUMBER ; calculate the checksum | |
; (magic number + checksum + flags should equal 0) | |
section .text: ; start of the text (code) section | |
align 4 ; the code must be 4 byte aligned |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
megs: 32 | |
display_library: sdl | |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENTRY(loader) /* the name of the entry label */ | |
SECTIONS { | |
. = 0x00100000; /* the code should be loaded at 1 MB */ | |
.text ALIGN (0x1000) : /* align at 4 KB */ | |
{ | |
*(.text) /* all text sections from all files */ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global loader ; the entry symbol for ELF | |
MAGIC_NUMBER equ 0x1BADB002 ; define the magic number constant | |
FLAGS equ 0x0 ; multiboot flags | |
CHECKSUM equ -MAGIC_NUMBER ; calculate the checksum | |
; (magic number + checksum + flags should equal 0) | |
section .text: ; start of the text (code) section | |
align 4 ; the code must be 4 byte aligned | |
dd MAGIC_NUMBER ; write the magic number to the machine code, |