Skip to content

Commit

Permalink
Removed debug messages
Browse files Browse the repository at this point in the history
Hopefully no longer needed.
  • Loading branch information
vercas committed Nov 9, 2015
1 parent 8cb05de commit 4b24541
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
22 changes: 11 additions & 11 deletions beelzebub/arc/amd64/src/ap_bootstrap.s
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ ApBootstrapBegin:
mov edi, edx
; The NX bit support (bit 20) and PGE (bit 26) are needed.

debugchar 'A'
;debugchar 'A'
;breakpoint dummy

mov eax, cr4
Expand All @@ -68,13 +68,13 @@ ApBootstrapBegin:
mov cr4, eax
; And flush.

debugchar 'B'
;debugchar 'B'

mov eax, [BootstrapPml4Address - ApBootstrapBegin + PHYSADDR]
mov cr3, eax
; Load the PML4.

debugchar 'C'
;debugchar 'C'

mov ecx, 0xC0000080
rdmsr
Expand All @@ -90,28 +90,28 @@ ApBootstrapBegin:
wrmsr
; Writes the value to IA32_EFER

debugchar 'D'
;debugchar 'D'

mov eax, cr0
bts eax, 0
bts eax, 31
mov cr0, eax
; Protected mode and paging.

debugchar 'E'
;debugchar 'E'

lgdt [cs:ApBootstrapGdt64R - ApBootstrapBegin + PHYSADDR]
; Load a GDT which contains long mode segments.

debugchar 'F'
;debugchar 'F'

jmp 0x08:.long - ApBootstrapBegin + PHYSADDR
; Long jump into protected mode!

bits 64 ; Then long mode directly.

.long:
debugchar 'G'
;debugchar 'G'

mov ax, 0x10
mov ds, ax
Expand All @@ -122,25 +122,25 @@ bits 64 ; Then long mode directly.
; Make sure the data segments are correct.
; The following code involves data fetching, so better safe than sorry?

debugchar 'H'
;debugchar 'H'

mov rax, KernelGdtPointer
lgdt [rax]
; Load the GDT for domain 0.

debugchar 'I'
;debugchar 'I'

mov rax, ApStackTopPointer
mov rsp, qword [rax]
; The entry point will surely need a stack.

debugchar 'J'
;debugchar 'J'

mov rax, ApInitializationLock
mov dword [rax], 0
; Tell the BSP that initialization is complete.

debugchar 'K'
;debugchar 'K'

mov rax, kmain_ap
jmp rax
Expand Down
28 changes: 14 additions & 14 deletions beelzebub/arc/x86/src/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,15 +612,15 @@ Handle InitializeProcessingUnits()
memcpy((void *)bootstrapVaddr, &ApBootstrapBegin, (uintptr_t)&ApBootstrapEnd - (uintptr_t)&ApBootstrapBegin);
// This makes sure the code can be executed by the AP.

msg("AP bootstrap code @ %Xp:%us%n"
, &ApBootstrapBegin, (size_t)((uintptr_t)&ApBootstrapEnd - (uintptr_t)&ApBootstrapBegin));
//msg("AP bootstrap code @ %Xp:%us%n"
// , &ApBootstrapBegin, (size_t)((uintptr_t)&ApBootstrapEnd - (uintptr_t)&ApBootstrapBegin));

KernelGdtPointer = GdtRegister::Retrieve();

BREAKPOINT_SET_AUX((int volatile *)((uintptr_t)&ApBreakpointCookie - (uintptr_t)&ApBootstrapBegin + bootstrapVaddr));
int_cookie_t const int_cookie = Interrupts::PushEnable();

msg("Auxiliary breakpoint pointer @ %Xp.%n", breakpointEscapedAux);
//msg("Auxiliary breakpoint pointer @ %Xp.%n", breakpointEscapedAux);

MainTerminal->WriteFormat("%n PML4 addr: %XP, GDT addr: %Xp; BSP LAPIC ID: %u4"
, BootstrapPml4Address, KernelGdtPointer.Pointer, Lapic::GetId());
Expand Down Expand Up @@ -671,7 +671,7 @@ Handle InitializeProcessingUnits()
, "Failed to unmap unneeded page at %Xp (%XP) for init code: %H%n"
, bootstrapVaddr, bootstrapPaddr, res);

msg("Got %us cores.", Cpu::Count.Load());
//msg("Got %us cores.", Cpu::Count.Load());

return HandleResult::Okay;
}
Expand Down Expand Up @@ -711,7 +711,7 @@ Handle InitializeAp(uint32_t const lapicId
ApStackTopPointer = vaddr + PageSize;
ApInitializationLock = 1;

msg("Stack for AP #%us is at %Xp (%Xp, %XP).%n", apIndex, ApStackTopPointer, vaddr, paddr);
//msg("Stack for AP #%us is at %Xp (%Xp, %XP).%n", apIndex, ApStackTopPointer, vaddr, paddr);

memset((void *)vaddr, 0xF0, PageSize);
// Make sure it's writable.
Expand All @@ -724,17 +724,17 @@ Handle InitializeAp(uint32_t const lapicId

//for(;;) CpuInstructions::Halt();

msg("Sending INIT IPI to %u4...", lapicId);
//msg("Sending INIT IPI to %u4...", lapicId);

Lapic::SendIpi(initIcr);

msg(" Waiting...");
//msg(" Waiting...");

Wait(10 * 1000);
// Much more than the recommended amount, but this may be handy for busy
// virtualized environments.

msg(" Done.%n");
//msg(" Done.%n");

LapicIcr startupIcr = LapicIcr(0)
.SetDeliveryMode(InterruptDeliveryModes::StartUp)
Expand All @@ -743,29 +743,29 @@ Handle InitializeAp(uint32_t const lapicId
.SetVector(0x1000 >> 12)
.SetDestination(lapicId);

msg("Sending first startup IPI to %u4...", lapicId);
//msg("Sending first startup IPI to %u4...", lapicId);

Lapic::SendIpi(startupIcr);

msg(" Waiting...");
//msg(" Waiting...");

Wait(10 * 1000);

msg(" Done.%n");
//msg(" Done.%n");

if (ApInitializationLock != 0)
{
// It should be ready. Let's try again.

msg("Sending second startup IPI to %u4...", lapicId);
//msg("Sending second startup IPI to %u4...", lapicId);

Lapic::SendIpi(startupIcr);

msg(" Waiting...");
//msg(" Waiting...");

Wait(1000 * 1000);

msg(" Done.%n");
//msg(" Done.%n");

if (ApInitializationLock != 0)
return HandleResult::Timeout;
Expand Down

0 comments on commit 4b24541

Please sign in to comment.