Misc changes, fixing problems with long log strings
authorJohn Hodge <[email protected]>
Sun, 27 Feb 2011 10:51:27 +0000 (18:51 +0800)
committerJohn Hodge <[email protected]>
Sun, 27 Feb 2011 10:51:27 +0000 (18:51 +0800)
- Added a very early boot indicator (for RHW tests)
- Fixed some warning messages

Kernel/arch/x86/start.asm
Kernel/logging.c
Kernel/threads.c
Kernel/vfs/open.c

index 737ff2e..4be4130 100644 (file)
@@ -59,6 +59,8 @@ mboot:
 [extern kmain]
 [global start]
 start:
+       ; Just show we're here
+       mov WORD [0xB8000], 0x0741      ; 'A'
        
        ; Set up stack
        mov esp, Kernel_Stack_Top
@@ -71,13 +73,20 @@ start:
        or      ecx, 0x80010000 ; PG and WP
        mov cr0, ecx
        
+       mov WORD [0xB8002], 0x0763      ; 'c'
+       mov WORD [0xB8004], 0x0765      ; 'e'
+       
        lea ecx, [.higherHalf]
        jmp ecx
 .higherHalf:
+       
+       mov WORD [0xB8006], 0x0773      ; 's'
+       mov WORD [0xB8008], 0x0773      ; 's'
 
        ; Call the kernel
        push ebx        ; Multiboot Info
        push eax        ; Multiboot Magic Value
+       mov WORD [0xB800A], 0x0732      ; '2'
        call kmain
 
        ; Halt the Machine
@@ -222,7 +231,7 @@ CallWithArgArray:
 align 0x1000
 gaInitPageDir:
        dd      gaInitPageTable-KERNEL_BASE+3   ; 0x000 - Low kernel
-       times 0x300-1   dd      0
+       times 0x300-0x000-1     dd      0
        dd      gaInitPageTable-KERNEL_BASE+3   ; 0xC00 - High kernel
        times 0x3F0-0x300-1     dd      0
        dd      gaInitPageDir-KERNEL_BASE+3     ; 0xFC0 - Fractal
index 17888a7..8132e5c 100644 (file)
@@ -153,13 +153,14 @@ void Log_AddEvent(const char *Ident, int Level, const char *Format, va_list Args
 void Log_Int_PrintMessage(tLogEntry *Entry)
 {
        SHORTLOCK( &glLogOutput );
-       LogF("%s%014lli%s [%+8s] %s\x1B[0m\r\n",
+       LogF("%s%014lli%s [%+8s] %s",
                csaLevelColours[Entry->Level],
                Entry->Time,
                csaLevelCodes[Entry->Level],
                Entry->Ident,
                Entry->Data
                );
+       LogF("\x1B[0m\r\n");    // Separate in case Entry->Data is too long
        SHORTREL( &glLogOutput );
 }
 
index dc79908..ee48e3e 100644 (file)
@@ -725,7 +725,7 @@ int Threads_Wake(tThread *Thread)
        switch(Thread->Status)
        {
        case THREAD_STAT_ACTIVE:
-               Log("Thread_Wake: Waking awake thread (%i)", Thread->TID);
+               Log("Threads_Wake - Waking awake thread (%i)", Thread->TID);
                return -EALREADY;
        
        case THREAD_STAT_SLEEPING:
@@ -742,15 +742,15 @@ int Threads_Wake(tThread *Thread)
                return -EOK;
        
        case THREAD_STAT_WAITING:
-               Warning("Thread_Wake - Waiting threads are not currently supported");
+               Warning("Threads_Wake - Waiting threads are not currently supported");
                return -ENOTIMPL;
        
        case THREAD_STAT_DEAD:
-               Warning("Thread_Wake - Attempt to wake dead thread (%i)", Thread->TID);
+               Warning("Threads_Wake - Attempt to wake dead thread (%i)", Thread->TID);
                return -ENOTIMPL;
        
        default:
-               Warning("Thread_Wake - Unknown process status (%i)\n", Thread->Status);
+               Warning("Threads_Wake - Unknown process status (%i)\n", Thread->Status);
                return -EINTERNAL;
        }
 }
index 01d73d6..0820102 100644 (file)
@@ -41,7 +41,7 @@ char *VFS_GetAbsPath(const char *Path)
        if(Path[0] == '$') {
                ret = malloc(strlen(Path)+1);
                if(!ret) {
-                       Warning("VFS_GetAbsPath - malloc() returned NULL");
+                       Log_Warning("VFS", "VFS_GetAbsPath: malloc() returned NULL");
                        return NULL;
                }
                strcpy(ret, Path);
@@ -61,7 +61,7 @@ char *VFS_GetAbsPath(const char *Path)
        if(Path[0] == '/') {
                ret = malloc(pathLen + 1);
                if(!ret) {
-                       Warning("VFS_GetAbsPath - malloc() returned NULL");
+                       Log_Warning("VFS", "VFS_GetAbsPath: malloc() returned NULL");
                        return NULL;
                }
                strcpy(ret, Path);

UCC git Repository :: git.ucc.asn.au