Skip to content

Commit

Permalink
Prepare for alpha release - cleanup code and remove some debug instru…
Browse files Browse the repository at this point in the history
…ctions. Update reduceOS demo picture.
  • Loading branch information
sasdallas committed Dec 23, 2022
1 parent c6a67ab commit 7b89293
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 24 deletions.
Binary file modified obj/kernel.o
Binary file not shown.
Binary file modified obj/terminal.o
Binary file not shown.
Binary file modified out/img/reduceOS.img
Binary file not shown.
Binary file modified out/kernel/kernel.bin
Binary file not shown.
Binary file modified reduceOSDemo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion source/kernel/include/terminal.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ void terminalWriteStringXY(const char *data, size_t x, size_t y); // terminalWri
void terminalMoveArrowKeys(int arrowKey); // terminalMoveArrowKeys() - used by keyboard.c, a function to move the cursor around
void updateBottomText(char *bottomText); // updateBottomText() - A function to update that bottom bar of text
int printf(const char* restrict format, ...); // printf() - the main function of the entire file. Handles unlimited arguments, %s and %c, and scrolling.
void debugterminalPutchar(char c); // REMOVE
// As described in the C file, certain printf functions are NOT present in this file, like putc and print, as they are only helper functions for printf.
// They are likely going to be removed and merged into terminal.c.
#endif
11 changes: 10 additions & 1 deletion source/kernel/kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ int getSystemInformation(char *args[]) {
return 1; // Return
}


int help(char *args[]) {
printf("reduceOS v1.0-dev\nValid commands:\ntest, system, help\n");
return 1;
}

// kmain() - The most important function in all of reduceOS. Jumped here by loadKernel.asm.
void kmain(multiboot_info* mem) {
initTerminal(); // Initialize the terminal and clear the screen
Expand Down Expand Up @@ -128,9 +134,12 @@ void kmain(multiboot_info* mem) {

// Possible bug here in that used blocks isn't a valid number.
printf("regions initialized: %i; used blocks: %i; free blocks: %i\n", getBlockCount(), getUsedBlockCount(), getFreeBlockCount());


printf("reduceOS 1.0-dev has completed basic initialization.\nThe command line is now enabled. Type 'help' for help!\n");

registerCommand("test", (command*)testFunction);
registerCommand("system", (command*)getSystemInformation);
registerCommand("help", (command*)help);

char buffer[256]; // We will store keyboard input here.

Expand Down
22 changes: 0 additions & 22 deletions source/kernel/terminal.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,28 +110,6 @@ void terminalMoveArrowKeys(int arrowKey) {
}
}

// REMOVE:
void debugterminalPutchar(char c) {
int line;
unsigned char uc = c; // terminalPutcharXY() requires an unsigned char.

// Perform the scrolling stuff for X
if (terminalX == SCREEN_WIDTH) {
terminalX = 0;
terminalY++;
}

// Perform the scrolling stuff for Y
scrollTerminal();


terminalPutcharXY(uc, terminalColor, terminalX, terminalY); // Place an entry at terminal X and Y.
terminalX++;

// Update text mode cursor
updateTextCursor();
}


// terminalPutchar(char c) - This is the recommended function to use (besides printf, that'll be later) as it incorporates scrollTerminal and terminalDeleteLastLine.
void terminalPutchar(char c) {
Expand Down

0 comments on commit 7b89293

Please sign in to comment.