Skip to content

Commit

Permalink
Fix the boot screen.
Browse files Browse the repository at this point in the history
  • Loading branch information
mterwoord committed Jun 14, 2016
1 parent 7814655 commit 1d7fd7f
Show file tree
Hide file tree
Showing 20 changed files with 113 additions and 152 deletions.
2 changes: 1 addition & 1 deletion Users/Matthijs/DebugCompiler/MyEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public void Test(Type kernelToRun)
var xEngine = new Engine();
// Sets the time before an error is registered. For example if set to 60 then if a kernel runs for more than 60 seconds then
// that kernel will be marked as a failiure and terminated
xEngine.AllowedSecondsInKernel = 600;
xEngine.AllowedSecondsInKernel = 30;

// If you want to test only specific platforms, add them to the list, like next line. By default, all platforms are run.
xEngine.RunTargets.Add(RunTargetEnum.Bochs);
Expand Down
2 changes: 1 addition & 1 deletion source/Cosmos.Debug.DebugStub/AsmBreak.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; Generated at 6/12/2016 3:34:04 PM
; Generated at 6/14/2016 12:11:29 PM

DebugStub_AsmBreakEIP dd 0
DebugStub_AsmOrigByte dd 0
Expand Down
2 changes: 1 addition & 1 deletion source/Cosmos.Debug.DebugStub/CmdMisc.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; Generated at 6/12/2016 3:34:04 PM
; Generated at 6/14/2016 12:11:29 PM



Expand Down
2 changes: 1 addition & 1 deletion source/Cosmos.Debug.DebugStub/CmdProcess.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; Generated at 6/12/2016 3:34:04 PM
; Generated at 6/14/2016 12:11:29 PM



Expand Down
2 changes: 1 addition & 1 deletion source/Cosmos.Debug.DebugStub/CmdSend.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; Generated at 6/12/2016 3:34:04 PM
; Generated at 6/14/2016 12:11:29 PM



Expand Down
2 changes: 1 addition & 1 deletion source/Cosmos.Debug.DebugStub/Consts.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; Generated at 6/12/2016 3:34:04 PM
; Generated at 6/14/2016 12:11:29 PM


DebugStub_Const_Signature equ 427034631
Expand Down
2 changes: 1 addition & 1 deletion source/Cosmos.Debug.DebugStub/DebugStub.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; Generated at 6/12/2016 3:34:04 PM
; Generated at 6/14/2016 12:11:29 PM

DebugStub_CallerEBP dd 0
DebugStub_CallerEIP dd 0
Expand Down
66 changes: 1 addition & 65 deletions source/Cosmos.Debug.DebugStub/Init.asm
Original file line number Diff line number Diff line change
@@ -1,66 +1,2 @@
; Generated at 6/12/2016 3:34:04 PM

DebugStub_MaxBPId dd 0

DebugStub_DebugBPs: TIMES 256 dd 0

DebugStub_Init:
Call DebugStub_Cls
Call DebugStub_DisplayWaitMsg
Call DebugStub_InitSerial
Call DebugStub_WaitForDbgHandshake
Call DebugStub_Cls

DebugStub_Init_Exit:
mov dword [static_field__Cosmos_Core_INTs_mLastKnownAddress], DebugStub_Init_Exit
Ret


DebugStub_WaitForSignature:
mov dword EBX, 0x0

DebugStub_WaitForSignature_Block1_Begin:
cmp dword EBX, DebugStub_Const_Signature
JE near DebugStub_WaitForSignature_Block1_End
Call DebugStub_ComReadAL
mov byte BL, AL
ror dword EBX, 0x8
Jmp DebugStub_WaitForSignature_Block1_Begin

DebugStub_WaitForSignature_Block1_End:

DebugStub_WaitForSignature_Exit:
mov dword [static_field__Cosmos_Core_INTs_mLastKnownAddress], DebugStub_WaitForSignature_Exit
Ret


DebugStub_WaitForDbgHandshake:
mov byte AL, 0x0
Call DebugStub_ComWriteAL
mov byte AL, 0x0
Call DebugStub_ComWriteAL
mov byte AL, 0x0
Call DebugStub_ComWriteAL
push dword DebugStub_Const_Signature
mov dword ESI, ESP
Call DebugStub_ComWrite32
pop dword EAX
mov byte AL, DebugStub_Const_Ds2Vs_Started
Call DebugStub_ComWriteAL
Call DebugStub_WaitForSignature
Call DebugStub_ProcessCommandBatch
Call DebugStub_Hook_OnHandshakeCompleted

DebugStub_WaitForDbgHandshake_Exit:
mov dword [static_field__Cosmos_Core_INTs_mLastKnownAddress], DebugStub_WaitForDbgHandshake_Exit
Ret

%ifndef Exclude_Dummy_Hooks

DebugStub_Hook_OnHandshakeCompleted:

DebugStub_Hook_OnHandshakeCompleted_Exit:
mov dword [static_field__Cosmos_Core_INTs_mLastKnownAddress], DebugStub_Hook_OnHandshakeCompleted_Exit
Ret

%endif
Object reference not set to an instance of an object.
72 changes: 37 additions & 35 deletions source/Cosmos.Debug.DebugStub/Screen.asm
Original file line number Diff line number Diff line change
@@ -1,47 +1,49 @@
; Generated at 6/12/2016 3:34:04 PM
; Generated at 14-6-2016 12:37:38

DebugWaitMsg db 96, 87, 97, 105, 116, 105, 110, 103, 32, 102, 111, 114, 32, 100, 101, 98, 117, 103, 103, 101, 114, 32, 99, 111, 110, 110, 101, 99, 116, 105, 111, 110, 46, 46, 46, 96, 0

%ifndef Exclude_Memory_Based_Console
DebugStub_Const_VidBase equ 753664
DebugWaitMsg db 87, 97, 105, 116, 105, 110, 103, 32, 102, 111, 114, 32, 100, 101, 98, 117, 103, 103, 101, 114, 32, 99, 111, 110, 110, 101, 99, 116, 105, 111, 110, 46, 46, 46, 0

DebugStub_Cls:
mov dword ESI, DebugStub_Const_VidBase
%ifndef Exclude_Memory_Based_Console
DebugStub_Const_VidBase equ 753664

DebugStub_Cls_Block1_Begin:
cmp dword ESI, 0xB8FA0
JNB near DebugStub_Cls_Block1_End
mov dword [ESI], 0x0
inc dword ESI
mov dword [ESI], 0xA
inc dword ESI
Jmp DebugStub_Cls_Block1_Begin
DebugStub_Cls:
mov dword ESI, DebugStub_Const_VidBase

DebugStub_Cls_Block1_End:
DebugStub_Cls_Block1_Begin:
cmp dword ESI, 0xB8FA0
JNB near DebugStub_Cls_Block1_End
mov dword [ESI], 0x0
inc dword ESI
mov dword [ESI], 0xA
inc dword ESI
Jmp DebugStub_Cls_Block1_Begin

DebugStub_Cls_Exit:
mov dword [static_field__Cosmos_Core_INTs_mLastKnownAddress], DebugStub_Cls_Exit
Ret
DebugStub_Cls_Block1_End:

DebugStub_Cls_Exit:
mov dword [static_field__Cosmos_Core_INTs_mLastKnownAddress], DebugStub_Cls_Exit
Ret

DebugStub_DisplayWaitMsg:
mov dword ESI, DebugWaitMsg
mov dword EDI, DebugStub_Const_VidBase
add dword EDI, 0x668

DebugStub_DisplayWaitMsg_Block1_Begin:
cmp dword [ESI], 0x0
JE near DebugStub_DisplayWaitMsg_Block1_End
mov byte AL, [ESI]
mov byte [EDI], AL
inc dword ESI
add dword EDI, 0x2
Jmp DebugStub_DisplayWaitMsg_Block1_Begin
DebugStub_DisplayWaitMsg:
mov dword ESI, DebugWaitMsg
mov dword EDI, DebugStub_Const_VidBase
add dword EDI, 0x668

DebugStub_DisplayWaitMsg_Block1_End:
DebugStub_DisplayWaitMsg_Block1_Begin:
cmp byte [ESI], 0x0
JE near DebugStub_DisplayWaitMsg_Block1_End
mov byte AL, [ESI]
mov byte [EDI], AL
inc dword ESI
add dword EDI, 0x2
Jmp DebugStub_DisplayWaitMsg_Block1_Begin

DebugStub_DisplayWaitMsg_Exit:
mov dword [static_field__Cosmos_Core_INTs_mLastKnownAddress], DebugStub_DisplayWaitMsg_Exit
Ret
DebugStub_DisplayWaitMsg_Block1_End:

DebugStub_DisplayWaitMsg_Exit:
mov dword [static_field__Cosmos_Core_INTs_mLastKnownAddress], DebugStub_DisplayWaitMsg_Exit
Ret

%endif

%endif
4 changes: 2 additions & 2 deletions source/Cosmos.Debug.DebugStub/Screen.xs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const VidBase = $B8000

function Cls {
ESI = #VidBase

// End of Video Area
// VidBase + 25 * 80 * 2 = B8FA0
while ESI < $B8FA0 {
Expand Down Expand Up @@ -38,4 +38,4 @@ function DisplayWaitMsg {
}
}

! %endif
! %endif
2 changes: 1 addition & 1 deletion source/Cosmos.Debug.DebugStub/Serial.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; Generated at 6/12/2016 3:34:04 PM
; Generated at 6/14/2016 12:11:29 PM


%ifndef Exclude_IOPort_Based_SerialInit
Expand Down
2 changes: 1 addition & 1 deletion source/Cosmos.Debug.DebugStub/SerialHelpers.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; Generated at 6/12/2016 3:34:04 PM
; Generated at 6/14/2016 12:11:29 PM



Expand Down
2 changes: 1 addition & 1 deletion source/Cosmos.Debug.DebugStub/SerialIO.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; Generated at 6/12/2016 3:34:04 PM
; Generated at 6/14/2016 12:11:29 PM

DebugStub_ComAddr dd 1016

Expand Down
2 changes: 1 addition & 1 deletion source/Cosmos.Debug.DebugStub/TracerEntry.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; Generated at 6/12/2016 3:34:04 PM
; Generated at 6/14/2016 12:11:29 PM



Expand Down
2 changes: 1 addition & 1 deletion source/Cosmos.Debug.DebugStub/Utilities.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; Generated at 6/12/2016 3:34:04 PM
; Generated at 6/14/2016 12:11:29 PM



Expand Down
41 changes: 20 additions & 21 deletions source/XSharp.Compiler/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,27 @@ static void Main(string[] aArgs) {

var xGenerator = new AsmGenerator();

string[] xFiles;
if (Directory.Exists(xSrc))
{
xFiles = Directory.GetFiles(xSrc, "*.xs");
}
else
{
xFiles = new string[] { xSrc };
}
foreach (var xFile in xFiles)
{
xGenerator.GenerateToFiles(xFile);
}

// var xAsm = new Assembler();
// var xStreamReader = new StringReader(@"namespace Test
// var CallerEBP
// while ESI != .CallerEBP {
// ! nop
//string[] xFiles;
//if (Directory.Exists(xSrc))
//{
// xFiles = Directory.GetFiles(xSrc, "*.xs");
//}
//else
//{
// xFiles = new string[] { xSrc };
//}
// ");
// var xResult = xGenerator.Generate(xStreamReader);
//foreach (var xFile in xFiles)
//{
// xGenerator.GenerateToFiles(xFile);
//}

var xAsm = new Assembler();
var xStreamReader = new StringReader(@"namespace Test
while byte ESI[0] != 0 {
! nop
}
");
var xResult = xGenerator.Generate(xStreamReader);
Console.WriteLine("done");
} catch (Exception ex) {
Console.WriteLine(ex.ToString());
Expand Down
Loading

0 comments on commit 1d7fd7f

Please sign in to comment.