Skip to content

Commit

Permalink
Oops!
Browse files Browse the repository at this point in the history
  • Loading branch information
eersoy93 committed Feb 20, 2024
1 parent 6919f2e commit 8a0fe73
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/link.ld
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ENTRY(kernel_entry)
ENTRY(shell_entry)

SECTIONS
{
Expand Down
2 changes: 1 addition & 1 deletion src/shell/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "../libc/io.h"
#include "../libc/sound.h"
#include "../libc/string.h"
#include "kernel_main.h"
#include "shell_main.h"
#include "paging.h"

struct command commands[] = {
Expand Down
2 changes: 1 addition & 1 deletion src/shell/paging.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "paging.h"

#include "kernel_main.h"
#include "shell_main.h"
#include "../libc/io.h"
#include "../libc/memory.h"
#include "../libc/string.h"
Expand Down
16 changes: 8 additions & 8 deletions src/shell/kernel_entry.asm → src/shell/shell_entry.asm
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@
; COPYRIGHT: Copyright (c) 2024 Erdem Ersoy (eersoy93).
; LICENSE: Licensed with MIT License. See LICENSE file for details.

global kernel_entry
global shell_entry

MAGIC_NUMBER equ 0x1BADB002
FLAGS equ 0x0
CHECKSUM equ -MAGIC_NUMBER
KERNEL_STACK_SIZE equ 4096
SHELL_STACK_SIZE equ 4096

extern kernel_main
extern shell_main

section .bss
align 4

kernel_stack:
resb KERNEL_STACK_SIZE
shell_stack:
resb SHELL_STACK_SIZE

section .text
align 4
dd MAGIC_NUMBER
dd FLAGS
dd CHECKSUM

kernel_entry:
mov esp, kernel_stack + KERNEL_STACK_SIZE
call kernel_main
shell_entry:
mov esp, shell_stack + SHELL_STACK_SIZE
call shell_main

.loop:
jmp .loop
6 changes: 3 additions & 3 deletions src/shell/kernel_main.c → src/shell/shell_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* LICENSE: Licensed with MIT License. See LICENSE file for details.
*/

#include "kernel_main.h"
#include "shell_main.h"

#include "command.h"
#include "../libc/boolean.h"
Expand All @@ -15,11 +15,11 @@
#include "../libc/string.h"
#include "../libc/video.h"

void kernel_main(void)
void shell_main(void)
{
cls();

println("Executing the kernel...", OUTPUT_COLOR);
println("Executing the shell...", OUTPUT_COLOR);

if (get_video_type() == VIDEO_TYPE_COLOR)
{
Expand Down
4 changes: 2 additions & 2 deletions src/shell/kernel_main.h → src/shell/shell_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* LICENSE: Licensed with MIT License. See LICENSE file for details.
*/

#ifndef KERNEL_MAIN_H
#define KERNEL_MAIN_H
#ifndef SHELL_MAIN_H
#define SHELL_MAIN_H

void show_prompt(void);

Expand Down

0 comments on commit 8a0fe73

Please sign in to comment.