Stuff
This commit is contained in:
parent
feee90c3d0
commit
f82fe88dab
|
@ -22,6 +22,7 @@
|
||||||
// along with OS/K. If not, see <https://www.gnu.org/licenses/>. //
|
// along with OS/K. If not, see <https://www.gnu.org/licenses/>. //
|
||||||
//----------------------------------------------------------------------------//
|
//----------------------------------------------------------------------------//
|
||||||
|
|
||||||
|
#include <extras/buf.h>
|
||||||
#include <kernel/mboot.h>
|
#include <kernel/mboot.h>
|
||||||
#include <kernel/panic.h>
|
#include <kernel/panic.h>
|
||||||
#include <kernel/sched.h>
|
#include <kernel/sched.h>
|
||||||
|
@ -150,8 +151,9 @@ noreturn void BtStartKern(multiboot_info_t *mbInfo, uint mbMagic)
|
||||||
MmInitHeap();
|
MmInitHeap();
|
||||||
PsInitSched();
|
PsInitSched();
|
||||||
|
|
||||||
KeStartPanic("Test Panic %x", 4);
|
pstest();
|
||||||
|
|
||||||
// End this machine's suffering
|
// End this machine's suffering
|
||||||
|
BFlushBuf(BStdOut);
|
||||||
KeCrashSystem();
|
KeCrashSystem();
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,10 +81,6 @@ void PsUnlockSched(void) {
|
||||||
//
|
//
|
||||||
// The four priority classes of OS/2
|
// 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[] = {
|
const char *PsPrioClassesNames[] = {
|
||||||
"Time-critical class",
|
"Time-critical class",
|
||||||
|
@ -177,9 +173,6 @@ void PsSchedThisProc(Process_t *proc)
|
||||||
//
|
//
|
||||||
// Selects process to schedule next
|
// Selects process to schedule next
|
||||||
//
|
//
|
||||||
// WARNING
|
|
||||||
// Does not call SchedLock()/SchedUnlock()
|
|
||||||
//
|
|
||||||
static Process_t *SelectSchedNext(void)
|
static Process_t *SelectSchedNext(void)
|
||||||
{
|
{
|
||||||
if (TimeCritProcs->length > 0)
|
if (TimeCritProcs->length > 0)
|
||||||
|
@ -293,7 +286,7 @@ leave:
|
||||||
PsUnlockSched();
|
PsUnlockSched();
|
||||||
|
|
||||||
if (PsCurProc != NULL && PsCurProc != previous) {
|
if (PsCurProc != NULL && PsCurProc != previous) {
|
||||||
// XXX context switch
|
// dispatch & context switch
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -409,7 +402,7 @@ void pstest(void)
|
||||||
KernLog("Tick %d - Running: ", tick);
|
KernLog("Tick %d - Running: ", tick);
|
||||||
|
|
||||||
if (PsCurProc == NULL) {
|
if (PsCurProc == NULL) {
|
||||||
KernLog("IDLE");
|
KernLog("IDLE\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
|
@ -419,7 +412,7 @@ void pstest(void)
|
||||||
PsSchedOnTick();
|
PsSchedOnTick();
|
||||||
|
|
||||||
if (tick == 50) // already done
|
if (tick == 50) // already done
|
||||||
KernLog("Re-scheduling process 0");
|
KernLog("Re-scheduling process 0\n");
|
||||||
|
|
||||||
tick++;
|
tick++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -285,13 +285,21 @@ error_t vbprintf(Buffer_t *buf, const char *fmt, va_list ap)
|
||||||
if (width < 12) width = 12;
|
if (width < 12) width = 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unknown/unsupported modifier
|
// End of string too soon
|
||||||
// Note: a '\0' after length field falls here
|
else if (type == '\0') {
|
||||||
else {
|
bputc(buf, '%');
|
||||||
rc = EINVAL;
|
rc = EINVAL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Unknown/unsupported modifier
|
||||||
|
else {
|
||||||
|
bputc(buf, '%');
|
||||||
|
bputc(buf, '?');
|
||||||
|
rc = bputc(buf, type);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Numerical conversions
|
// Numerical conversions
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue