diff --git a/bootloader/stage1/main.c b/bootloader/stage1/main.c index bd738e2a..1a28a832 100644 --- a/bootloader/stage1/main.c +++ b/bootloader/stage1/main.c @@ -32,8 +32,9 @@ void read(unsigned char count, unsigned char sector, short segment, short offset */ void main() { - PRINT("Loading...\r\n"); + PRINT("Loading... "); read(2,2,0,0x7e00); + PRINT("Ready.\r\n"); /* Let's do this... */ __asm__ __volatile__ ("jmp $0x00, $0x7e00"); diff --git a/bootloader/stage1/start.s b/bootloader/stage1/start.s index 27ef995f..7ccf6f30 100644 --- a/bootloader/stage1/start.s +++ b/bootloader/stage1/start.s @@ -1,17 +1,5 @@ -# Mr. Boots - Stage 1 -# Find Stage 2 and immediately load it. -# -# NOTICE: This stage should be loaded from a partition on -# an EXT2-only disk without a partition table. -# If you want to use it with a different set up -# you need to patch it to include an MBR header -# and all the other necessary bits. -# -# Part of the ToAruOS Distribution of the ToAru Kernel -# -# NCSA license is available from the root directory of the -# source tree in which this file is shipped. # +# Mr. Boots - Stage 1 (ASM entry point) # .code16 diff --git a/bootloader/stage2/main.c b/bootloader/stage2/main.c index ac17a773..d7bd902f 100644 --- a/bootloader/stage2/main.c +++ b/bootloader/stage2/main.c @@ -7,22 +7,16 @@ */ __asm__(".code16gcc\n"); -void kprint(short s) -{ - __asm__ __volatile__ ("movw %0, %%si\n" - "call _print" : : "l" ((short)s)); -} +#define PRINT(s) __asm__ ("movw %0, %%si\ncall _print" : : "l"((short)(int)s)) /* * Main entry point */ -int main() { - kprint((short)(int)"Welcome to C!\r\n"); +void main() +{ + PRINT("== Mr. Boots Stage 2 Bootloader ==\r\n"); /* And that's it for now... */ __asm__ __volatile__ ("hlt"); while (1) {}; - - /* Uh oh */ - return -1; } diff --git a/bootloader/stage2/start.s b/bootloader/stage2/start.s index 2f089def..70fbeaee 100644 --- a/bootloader/stage2/start.s +++ b/bootloader/stage2/start.s @@ -15,15 +15,8 @@ _start: movw $0x7bf0,%sp # stack pointer - movw $bmsga, %si # Print "Starting..." - calll _print # ... - .extern main # Jump the C main entry point... - calll main - - movw $bmsgb, %si # We should not be here... - calll _print # ... - hlt + jmp main _print: movb $0x0E,%ah # set registers for @@ -37,10 +30,3 @@ _print.next: jmp _print.next # continue _print.return: retl - -.data - -bmsga: - .string "Starting Stage 2...\r\n" -bmsgb: - .string "Critical failure!\r\n"