Step 0 : InitTerms() is the bug
This commit is contained in:
parent
c39f733e6d
commit
1beaf2b46d
|
@ -48,16 +48,7 @@ KERNDIR=kaleid/kernel
|
||||||
SYSTDIR=kaleid/system
|
SYSTDIR=kaleid/system
|
||||||
LINXDIR=kaleid/test
|
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
|
// COMMON MAKEFILE
|
||||||
|
|
||||||
COBJDIR=$(OBJDIR)/$(COMMDIR)
|
COBJDIR=$(OBJDIR)/$(COMMDIR)
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
; You should have received a copy of the GNU General Public License ;
|
; You should have received a copy of the GNU General Public License ;
|
||||||
; along with OS/K. If not, see <https://www.gnu.org/licenses/>. ;
|
; along with OS/K. If not, see <https://www.gnu.org/licenses/>. ;
|
||||||
;=----------------------------------------------------------------------------=;
|
;=----------------------------------------------------------------------------=;
|
||||||
|
global testf
|
||||||
|
|
||||||
;;VIDEO
|
;;VIDEO
|
||||||
%define TRAM 0xB8000 ; [T]ext[RAM]
|
%define TRAM 0xB8000 ; [T]ext[RAM]
|
||||||
|
@ -41,6 +41,17 @@ VGA_X dq 0
|
||||||
|
|
||||||
[BITS 64]
|
[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 ;
|
; x64/LM Clear Text Screen Function ;
|
||||||
|
|
|
@ -62,15 +62,15 @@ MB_start:
|
||||||
; Prints 'ERR:XX' where 'XX' is the str in AX ;
|
; Prints 'ERR:XX' where 'XX' is the str in AX ;
|
||||||
; ---------------------------------------------------------------------------- ;
|
; ---------------------------------------------------------------------------- ;
|
||||||
Error:
|
Error:
|
||||||
mov word [CODE], ax
|
mov word [.code], ax
|
||||||
push esi
|
push esi
|
||||||
mov bl, 0x0c
|
mov bl, 0x0c
|
||||||
mov esi, ERGO
|
mov esi, .ergo
|
||||||
call write32
|
call write32
|
||||||
pop esi
|
pop esi
|
||||||
jmp Die
|
jmp Die
|
||||||
ERGO : db "A", 219, 219, " Error "
|
.ergo : db 219, 219, 219, " Error "
|
||||||
CODE : db "00"
|
.code : db "00"
|
||||||
db 0x0
|
db 0x0
|
||||||
; ---------------------------------------------------------------------------- ;
|
; ---------------------------------------------------------------------------- ;
|
||||||
; Kills the mind of your computer to get it prostrated ;
|
; Kills the mind of your computer to get it prostrated ;
|
||||||
|
@ -101,11 +101,11 @@ lbegin:
|
||||||
call clear ; Clear the screen
|
call clear ; Clear the screen
|
||||||
|
|
||||||
;; BEGIN OF CHECKLIST
|
;; 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 Check_cpuid ; Check if cpuid supported, ERR 02
|
||||||
call Is64Bits ; Check if long mode available
|
call Is64Bits ; Check if long mode available, ERR 03
|
||||||
call CheckA20 ; Check if A20 is correctly enable
|
call CheckA20 ; Check if A20 is correctly enable, ERR 04
|
||||||
|
|
||||||
;; BEGIN OF WORK
|
;; BEGIN OF WORK
|
||||||
call Setup_paging ; Enable paging
|
call Setup_paging ; Enable paging
|
||||||
|
@ -126,6 +126,7 @@ lbegin:
|
||||||
|
|
||||||
x64_K db "Now in x64 long mode", 0x0A, 0x0D, 0x0
|
x64_K db "Now in x64 long mode", 0x0A, 0x0D, 0x0
|
||||||
GoKernel db "Launching Kernel...", 0
|
GoKernel db "Launching Kernel...", 0
|
||||||
|
nokernel db "ERROR 05 : Kernel launching error",0
|
||||||
|
|
||||||
_loader64:
|
_loader64:
|
||||||
;; Some cleanup
|
;; Some cleanup
|
||||||
|
@ -155,4 +156,7 @@ _loader64:
|
||||||
jmp StartKern
|
jmp StartKern
|
||||||
|
|
||||||
;; We must never reach this point ------------------------------------------- ;;
|
;; We must never reach this point ------------------------------------------- ;;
|
||||||
|
mov bl, 0x0c
|
||||||
|
mov esi, nokernel ; Error 05
|
||||||
|
call write
|
||||||
jmp Die
|
jmp Die
|
||||||
|
|
|
@ -25,10 +25,12 @@
|
||||||
#include <kernel/term.h>
|
#include <kernel/term.h>
|
||||||
#include <kernel/panic.h>
|
#include <kernel/panic.h>
|
||||||
|
|
||||||
|
|
||||||
|
extern void testf(void);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Entry point of the Kaleid kernel
|
// Entry point of the Kaleid kernel
|
||||||
//
|
//
|
||||||
|
|
||||||
noreturn void StartKern(void *mbInfo, int mbMagic)
|
noreturn void StartKern(void *mbInfo, int mbMagic)
|
||||||
{
|
{
|
||||||
(void)mbInfo;
|
(void)mbInfo;
|
||||||
|
@ -39,12 +41,12 @@ noreturn void StartKern(void *mbInfo, int mbMagic)
|
||||||
|
|
||||||
volatile ushort *vga = (volatile ushort *)0xB8000;
|
volatile ushort *vga = (volatile ushort *)0xB8000;
|
||||||
|
|
||||||
*vga++ = 'AA';
|
|
||||||
|
|
||||||
// Kernel terminals
|
// Kernel terminals
|
||||||
//InitTerms();
|
//InitTerms();
|
||||||
|
|
||||||
|
*vga++ = ('A' << 8 | 0x0F);
|
||||||
|
|
||||||
// We're out
|
// We're out
|
||||||
//StartPanic("Goodbye World :(");
|
StartPanic("Goodbye World :(");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue