diff --git a/kaleid/kernel/init/init.c b/kaleid/kernel/init/init.c
index a0e978b..896c77e 100644
--- a/kaleid/kernel/init/init.c
+++ b/kaleid/kernel/init/init.c
@@ -22,6 +22,7 @@
// along with OS/K. If not, see . //
//----------------------------------------------------------------------------//
+#include
#include
#include
#include
@@ -150,8 +151,9 @@ noreturn void BtStartKern(multiboot_info_t *mbInfo, uint mbMagic)
MmInitHeap();
PsInitSched();
- KeStartPanic("Test Panic %x", 4);
+ pstest();
// End this machine's suffering
+ BFlushBuf(BStdOut);
KeCrashSystem();
}
diff --git a/kaleid/kernel/ps/sched.c b/kaleid/kernel/ps/sched.c
index 4fdf459..665754a 100644
--- a/kaleid/kernel/ps/sched.c
+++ b/kaleid/kernel/ps/sched.c
@@ -81,10 +81,6 @@ void PsUnlockSched(void) {
//
// The four priority classes of OS/2
//
-/*CREATE_PER_CPU(TimeCritProcs, ListHead_t *);
-CREATE_PER_CPU(ServPrioProcs, ListHead_t *);
-CREATE_PER_CPU(ReglPrioProcs, ListHead_t *);
-CREATE_PER_CPU(IdlePrioProcs, ListHead_t *);*/
const char *PsPrioClassesNames[] = {
"Time-critical class",
@@ -177,9 +173,6 @@ void PsSchedThisProc(Process_t *proc)
//
// Selects process to schedule next
//
-// WARNING
-// Does not call SchedLock()/SchedUnlock()
-//
static Process_t *SelectSchedNext(void)
{
if (TimeCritProcs->length > 0)
@@ -293,7 +286,7 @@ leave:
PsUnlockSched();
if (PsCurProc != NULL && PsCurProc != previous) {
- // XXX context switch
+ // dispatch & context switch
}
}
@@ -409,7 +402,7 @@ void pstest(void)
KernLog("Tick %d - Running: ", tick);
if (PsCurProc == NULL) {
- KernLog("IDLE");
+ KernLog("IDLE\n");
}
else {
@@ -419,7 +412,7 @@ void pstest(void)
PsSchedOnTick();
if (tick == 50) // already done
- KernLog("Re-scheduling process 0");
+ KernLog("Re-scheduling process 0\n");
tick++;
}
diff --git a/kaleid/libbuf/bprint.c b/kaleid/libbuf/bprint.c
index aeab335..9936b90 100644
--- a/kaleid/libbuf/bprint.c
+++ b/kaleid/libbuf/bprint.c
@@ -285,13 +285,21 @@ error_t vbprintf(Buffer_t *buf, const char *fmt, va_list ap)
if (width < 12) width = 12;
}
- // Unknown/unsupported modifier
- // Note: a '\0' after length field falls here
- else {
+ // End of string too soon
+ else if (type == '\0') {
+ bputc(buf, '%');
rc = EINVAL;
break;
}
+ // Unknown/unsupported modifier
+ else {
+ bputc(buf, '%');
+ bputc(buf, '?');
+ rc = bputc(buf, type);
+ continue;
+ }
+
//
// Numerical conversions
//