fixed line endings on text files
git-svn-id: svn://anubis/hos/trunk@93 5b3e749e-e535-0410-8002-a9bb6afbdfca
This commit is contained in:
1 parent
ca82cc32ac
commit
24485b8143
19 files changed
+1444
-1444
No files matched your search
+84
-84
@@ -1,84 +1,84 @@
|
||||
|
||||
#include "k_bootstrap.h"
|
||||
#include "k_main.h"
|
||||
#include "hos_types.h"
|
||||
#include "hos_defines.h"
|
||||
#include "multiboot.h"
|
||||
#include "sys/cpu.h"
|
||||
#include "k_early_panic.h"
|
||||
#include "mm/mm.h"
|
||||
#include "lang/kio.h"
|
||||
#include "isr/interrupts.h"
|
||||
|
||||
#define DEBUG_LETTER(col,chr) *(u16_t *)(KERNEL_OFFSET + CONSOLE_MEMORY \
|
||||
+ 160 * 8 + (col) * 2) \
|
||||
= 0x0700 | (chr)
|
||||
extern "C" {
|
||||
|
||||
u8_t bootstrap_stack[4096];
|
||||
|
||||
/**************************************************************************
|
||||
* Multiboot header data block *
|
||||
*************************************************************************/
|
||||
u32_t mb_header[] __attribute__ ((section (".multiboot_header") )) = {
|
||||
MB_HEADER_MAGIC, /* magic */
|
||||
MB_HEADER_FLAGS, /* flags */
|
||||
-(MB_HEADER_MAGIC + MB_HEADER_FLAGS) /* checksum */
|
||||
};
|
||||
|
||||
/**************************************************************************
|
||||
* This function is invoked to bootstrap the kernel. *
|
||||
*************************************************************************/
|
||||
void k_bootstrap(mb_info_t * mb_info, u32_t mb_magic)
|
||||
{
|
||||
DEBUG_LETTER(1, 'b');
|
||||
|
||||
if (mb_magic != MB_BOOTLOADER_MAGIC)
|
||||
{
|
||||
k_early_panic("Bad multiboot magic identifier!");
|
||||
}
|
||||
|
||||
if ( ! (mb_info->flags & MB_BOOTLOADER_MMAP) )
|
||||
{
|
||||
k_early_panic("No memory map provided by bootloader!");
|
||||
}
|
||||
|
||||
for (mb_mmap_t * mmap = (mb_mmap_t *) (mb_info->mmap_addr + KERNEL_OFFSET),
|
||||
* end = (mb_mmap_t *) ((u32_t)mmap + mb_info->mmap_length);
|
||||
mmap < end;
|
||||
mmap = (mb_mmap_t *) (((u32_t)mmap) + mmap->size + 4))
|
||||
{
|
||||
// kprintf(" ** size: %d, type: %d ", mmap->size, mmap->type);
|
||||
mm_record_mmap_entry(mmap);
|
||||
}
|
||||
|
||||
DEBUG_LETTER(2, 'c');
|
||||
|
||||
/*
|
||||
* These functions could destroy the multiboot information block and
|
||||
* associated structures, so we must be finished reading those structures
|
||||
* before calling them.
|
||||
*/
|
||||
mm_bootstrap();
|
||||
DEBUG_LETTER(3, 'd');
|
||||
interrupts_bootstrap();
|
||||
DEBUG_LETTER(4, 'e');
|
||||
kio_bootstrap();
|
||||
DEBUG_LETTER(5, 'f');
|
||||
|
||||
/* begin using the permanent stack */
|
||||
write_esp(KERNEL_STACK_TOP);
|
||||
k_main();
|
||||
|
||||
idle_loop();
|
||||
}
|
||||
|
||||
void idle_loop()
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
__asm__ __volatile__ ("hlt");
|
||||
}
|
||||
}
|
||||
|
||||
} /* extern "C" */
|
||||
|
||||
#include "k_bootstrap.h"
|
||||
#include "k_main.h"
|
||||
#include "hos_types.h"
|
||||
#include "hos_defines.h"
|
||||
#include "multiboot.h"
|
||||
#include "sys/cpu.h"
|
||||
#include "k_early_panic.h"
|
||||
#include "mm/mm.h"
|
||||
#include "lang/kio.h"
|
||||
#include "isr/interrupts.h"
|
||||
|
||||
#define DEBUG_LETTER(col,chr) *(u16_t *)(KERNEL_OFFSET + CONSOLE_MEMORY \
|
||||
+ 160 * 8 + (col) * 2) \
|
||||
= 0x0700 | (chr)
|
||||
extern "C" {
|
||||
|
||||
u8_t bootstrap_stack[4096];
|
||||
|
||||
/**************************************************************************
|
||||
* Multiboot header data block *
|
||||
*************************************************************************/
|
||||
u32_t mb_header[] __attribute__ ((section (".multiboot_header") )) = {
|
||||
MB_HEADER_MAGIC, /* magic */
|
||||
MB_HEADER_FLAGS, /* flags */
|
||||
-(MB_HEADER_MAGIC + MB_HEADER_FLAGS) /* checksum */
|
||||
};
|
||||
|
||||
/**************************************************************************
|
||||
* This function is invoked to bootstrap the kernel. *
|
||||
*************************************************************************/
|
||||
void k_bootstrap(mb_info_t * mb_info, u32_t mb_magic)
|
||||
{
|
||||
DEBUG_LETTER(1, 'b');
|
||||
|
||||
if (mb_magic != MB_BOOTLOADER_MAGIC)
|
||||
{
|
||||
k_early_panic("Bad multiboot magic identifier!");
|
||||
}
|
||||
|
||||
if ( ! (mb_info->flags & MB_BOOTLOADER_MMAP) )
|
||||
{
|
||||
k_early_panic("No memory map provided by bootloader!");
|
||||
}
|
||||
|
||||
for (mb_mmap_t * mmap = (mb_mmap_t *) (mb_info->mmap_addr + KERNEL_OFFSET),
|
||||
* end = (mb_mmap_t *) ((u32_t)mmap + mb_info->mmap_length);
|
||||
mmap < end;
|
||||
mmap = (mb_mmap_t *) (((u32_t)mmap) + mmap->size + 4))
|
||||
{
|
||||
// kprintf(" ** size: %d, type: %d ", mmap->size, mmap->type);
|
||||
mm_record_mmap_entry(mmap);
|
||||
}
|
||||
|
||||
DEBUG_LETTER(2, 'c');
|
||||
|
||||
/*
|
||||
* These functions could destroy the multiboot information block and
|
||||
* associated structures, so we must be finished reading those structures
|
||||
* before calling them.
|
||||
*/
|
||||
mm_bootstrap();
|
||||
DEBUG_LETTER(3, 'd');
|
||||
interrupts_bootstrap();
|
||||
DEBUG_LETTER(4, 'e');
|
||||
kio_bootstrap();
|
||||
DEBUG_LETTER(5, 'f');
|
||||
|
||||
/* begin using the permanent stack */
|
||||
write_esp(KERNEL_STACK_TOP);
|
||||
k_main();
|
||||
|
||||
idle_loop();
|
||||
}
|
||||
|
||||
void idle_loop()
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
__asm__ __volatile__ ("hlt");
|
||||
}
|
||||
}
|
||||
|
||||
} /* extern "C" */
|
||||
+18
-18
@@ -1,18 +1,18 @@
|
||||
|
||||
#include "hos_types.h"
|
||||
#include "hos_defines.h"
|
||||
#include "k_early_panic.h"
|
||||
|
||||
void k_early_panic(const char * msg)
|
||||
{
|
||||
char * dest = (char *) (CONSOLE_MEMORY + KERNEL_OFFSET);
|
||||
while (*msg)
|
||||
{
|
||||
*dest++ = *msg++;
|
||||
*dest++ = 0x04; /* red error message */
|
||||
}
|
||||
|
||||
/* infinite loop */
|
||||
for (;;)
|
||||
;
|
||||
}
|
||||
|
||||
#include "hos_types.h"
|
||||
#include "hos_defines.h"
|
||||
#include "k_early_panic.h"
|
||||
|
||||
void k_early_panic(const char * msg)
|
||||
{
|
||||
char * dest = (char *) (CONSOLE_MEMORY + KERNEL_OFFSET);
|
||||
while (*msg)
|
||||
{
|
||||
*dest++ = *msg++;
|
||||
*dest++ = 0x04; /* red error message */
|
||||
}
|
||||
|
||||
/* infinite loop */
|
||||
for (;;)
|
||||
;
|
||||
}
|
||||
+15
-15
@@ -1,15 +1,15 @@
|
||||
|
||||
#ifndef K_EARLY_PANIC_H
|
||||
#define K_EARLY_PANIC_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void k_early_panic(const char * msg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef K_EARLY_PANIC_H
|
||||
#define K_EARLY_PANIC_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void k_early_panic(const char * msg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user