Step 0 : InitTerms() is the bug

This commit is contained in:
Adrien Bourmault 2019-03-11 14:47:11 +01:00
parent c39f733e6d
commit 1beaf2b46d
4 changed files with 31 additions and 23 deletions

View File

@ -48,16 +48,7 @@ KERNDIR=kaleid/kernel
SYSTDIR=kaleid/system
LINXDIR=kaleid/test
//----------------------------------------------------------------------------#
// TESTING MAKEFILE
pseudo_kern:
$(ASM) $(BOOTFLAGS) $(BOOTDIR)/pseudo_kernel.s -o $(OBJDIR)/boot/pkernel.bin
testing: bootloader pseudo_kern
cat $(BINDIR)/bootloader.bin $(OBJDIR)/boot/pkernel.bin > $(BINDIR)/boot.bin
//----------------------------------------------------------------------------#
// COMMON MAKEFILE
COBJDIR=$(OBJDIR)/$(COMMDIR)

View File

@ -22,7 +22,7 @@
; You should have received a copy of the GNU General Public License ;
; along with OS/K. If not, see <https://www.gnu.org/licenses/>. ;
;=----------------------------------------------------------------------------=;
global testf
;;VIDEO
%define TRAM 0xB8000 ; [T]ext[RAM]
@ -41,6 +41,17 @@ VGA_X dq 0
[BITS 64]
testf:
push rsi
push rbx
mov esi, teststr
mov bl, 0xF
call write
pop rsi
pop rbx
ret
teststr: db "Salut",0
;-----------------------------------------------------------------------;
; x64/LM Clear Text Screen Function ;

View File

@ -62,16 +62,16 @@ MB_start:
; Prints 'ERR:XX' where 'XX' is the str in AX ;
; ---------------------------------------------------------------------------- ;
Error:
mov word [CODE], ax
mov word [.code], ax
push esi
mov bl, 0x0c
mov esi, ERGO
mov esi, .ergo
call write32
pop esi
jmp Die
ERGO : db "A", 219, 219, " Error "
CODE : db "00"
db 0x0
.ergo : db 219, 219, 219, " Error "
.code : db "00"
db 0x0
; ---------------------------------------------------------------------------- ;
; Kills the mind of your computer to get it prostrated ;
; ---------------------------------------------------------------------------- ;
@ -101,11 +101,11 @@ lbegin:
call clear ; Clear the screen
;; BEGIN OF CHECKLIST
call MB_check ; Check Multiboot State
call MB_check ; Check Multiboot State, ERR 01
call Check_cpuid ; Check if cpuid supported
call Is64Bits ; Check if long mode available
call CheckA20 ; Check if A20 is correctly enable
call Check_cpuid ; Check if cpuid supported, ERR 02
call Is64Bits ; Check if long mode available, ERR 03
call CheckA20 ; Check if A20 is correctly enable, ERR 04
;; BEGIN OF WORK
call Setup_paging ; Enable paging
@ -126,6 +126,7 @@ lbegin:
x64_K db "Now in x64 long mode", 0x0A, 0x0D, 0x0
GoKernel db "Launching Kernel...", 0
nokernel db "ERROR 05 : Kernel launching error",0
_loader64:
;; Some cleanup
@ -155,4 +156,7 @@ _loader64:
jmp StartKern
;; We must never reach this point ------------------------------------------- ;;
mov bl, 0x0c
mov esi, nokernel ; Error 05
call write
jmp Die

View File

@ -25,10 +25,12 @@
#include <kernel/term.h>
#include <kernel/panic.h>
extern void testf(void);
//
// Entry point of the Kaleid kernel
//
noreturn void StartKern(void *mbInfo, int mbMagic)
{
(void)mbInfo;
@ -39,12 +41,12 @@ noreturn void StartKern(void *mbInfo, int mbMagic)
volatile ushort *vga = (volatile ushort *)0xB8000;
*vga++ = 'AA';
// Kernel terminals
//InitTerms();
*vga++ = ('A' << 8 | 0x0F);
// We're out
//StartPanic("Goodbye World :(");
StartPanic("Goodbye World :(");
}