Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions Kernel/!Debug/Log.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ PError(const char* __Format__, ...)
SysErr err;
SysErr* Error = &err;
AcquireSpinLock(&ConsoleLock, Error);
uint32_t OldFG = Console.TXColor;
uint32_t OldBG = Console.BGColor;
// TODO: Rename the uint's.
uint32_t MainFG = Console.TXColor;
uint32_t MainBG = Console.BGColor;

PutPrint("[");
SetBGColor(ClrError, ClrInvisible);
Expand All @@ -39,7 +40,7 @@ PError(const char* __Format__, ...)
}

__builtin_va_end(args);
SetBGColor(OldFG, OldBG);
SetBGColor(MainFG, MainBG);
ReleaseSpinLock(&ConsoleLock, Error);
}

Expand All @@ -53,8 +54,8 @@ PWarn(const char* __Format__, ...)
SysErr err;
SysErr* Error = &err;
AcquireSpinLock(&ConsoleLock, Error);
uint32_t OldFG = Console.TXColor;
uint32_t OldBG = Console.BGColor;
uint32_t MainFG = Console.TXColor;
uint32_t MainBG = Console.BGColor;

PutPrint("[");
SetBGColor(ClrWarn, ClrInvisible);
Expand All @@ -80,7 +81,7 @@ PWarn(const char* __Format__, ...)
}

__builtin_va_end(args);
SetBGColor(OldFG, OldBG);
SetBGColor(MainFG, MainBG);
ReleaseSpinLock(&ConsoleLock, Error);
}

Expand All @@ -94,8 +95,8 @@ PInfo(const char* __Format__, ...)
SysErr err;
SysErr* Error = &err;
AcquireSpinLock(&ConsoleLock, Error);
uint32_t OldFG = Console.TXColor;
uint32_t OldBG = Console.BGColor;
uint32_t MainFG = Console.TXColor;
uint32_t MainBG = Console.BGColor;

PutPrint("[");
SetBGColor(ClrInfo, ClrInvisible);
Expand All @@ -121,7 +122,7 @@ PInfo(const char* __Format__, ...)
}

__builtin_va_end(args);
SetBGColor(OldFG, OldBG);
SetBGColor(MainFG, MainBG);
ReleaseSpinLock(&ConsoleLock, Error);
}

Expand All @@ -135,8 +136,8 @@ _PDebug(const char* __Format__, ...)
SysErr err;
SysErr* Error = &err;
AcquireSpinLock(&ConsoleLock, Error);
uint32_t OldFG = Console.TXColor;
uint32_t OldBG = Console.BGColor;
uint32_t MainFG = Console.TXColor;
uint32_t MainBG = Console.BGColor;

SetBGColor(ClrDebug, ClrInvisible);
PutPrint("[ DEBUG ]: ");
Expand All @@ -159,7 +160,7 @@ _PDebug(const char* __Format__, ...)
}

__builtin_va_end(args);
SetBGColor(OldFG, OldBG);
SetBGColor(MainFG, MainBG);
ReleaseSpinLock(&ConsoleLock, Error);
}

Expand All @@ -173,8 +174,8 @@ PSuccess(const char* __Format__, ...)
SysErr err;
SysErr* Error = &err;
AcquireSpinLock(&ConsoleLock, Error);
uint32_t OldFG = Console.TXColor;
uint32_t OldBG = Console.BGColor;
uint32_t MainFG = Console.TXColor;
uint32_t MainBG = Console.BGColor;

PutPrint("[");
SetBGColor(ClrSuccess, ClrInvisible);
Expand All @@ -200,6 +201,6 @@ PSuccess(const char* __Format__, ...)
}

__builtin_va_end(args);
SetBGColor(OldFG, OldBG);
SetBGColor(MainFG, MainBG);
ReleaseSpinLock(&ConsoleLock, Error);
}
6 changes: 3 additions & 3 deletions Kernel/!Debug/Printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ KrnPrintfColor(uint32_t __FG__, uint32_t __BG__, const char* __Format__, ...)
SysErr err;
SysErr* Error = &err;
AcquireSpinLock(&ConsoleLock, Error);
uint32_t OldFG = Console.TXColor;
uint32_t OldBG = Console.BGColor;
uint32_t MainFG = Console.TXColor;
uint32_t MainBG = Console.BGColor;

SetBGColor(__FG__, __BG__);

Expand All @@ -59,7 +59,7 @@ KrnPrintfColor(uint32_t __FG__, uint32_t __BG__, const char* __Format__, ...)
}

__builtin_va_end(args);
SetBGColor(OldFG, OldBG);
SetBGColor(MainFG, MainBG);
ReleaseSpinLock(&ConsoleLock, Error);
}

Expand Down
1 change: 1 addition & 0 deletions Kernel/Entry.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ _start(void)

for (;;)
{
// Halt the system.
__asm__("hlt");
}
}
1 change: 1 addition & 0 deletions SysApps/TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Better SysApps structure