added CXXFLAGS to disable rtti and exceptions; added C++ support to header files; moved mm.c to mm.cc to use C++ functionality
git-svn-id: svn://anubis/hos/trunk@32 5b3e749e-e535-0410-8002-a9bb6afbdfca
This commit is contained in:
parent
2faa2cc8d6
commit
db192f6d36
@ -10,7 +10,7 @@ LDSCRIPT := link.ld
|
|||||||
KERNEL := hos
|
KERNEL := hos
|
||||||
export CPPFLAGS := -I$(HOS_TOPLEVEL) -I$(HOS_TOPLEVEL)/include
|
export CPPFLAGS := -I$(HOS_TOPLEVEL) -I$(HOS_TOPLEVEL)/include
|
||||||
export CFLAGS := -Wall -O2
|
export CFLAGS := -Wall -O2
|
||||||
export CXXFLAGS := -Wall -O2
|
export CXXFLAGS := -Wall -O2 -fno-rtti -fno-exceptions
|
||||||
export LDFLAGS := -T $(LDSCRIPT) -Map $(KERNEL).map
|
export LDFLAGS := -T $(LDSCRIPT) -Map $(KERNEL).map
|
||||||
|
|
||||||
SUBDIRS := boot mm
|
SUBDIRS := boot mm
|
||||||
|
@ -2,6 +2,14 @@
|
|||||||
#ifndef K_EARLY_PANIC_H
|
#ifndef K_EARLY_PANIC_H
|
||||||
#define K_EARLY_PANIC_H
|
#define K_EARLY_PANIC_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
void k_early_panic(const char * msg);
|
void k_early_panic(const char * msg);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -2,6 +2,10 @@
|
|||||||
#ifndef HOS_DEFINES_H
|
#ifndef HOS_DEFINES_H
|
||||||
#define HOS_DEFINES_H
|
#define HOS_DEFINES_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
#define HOS_KERNEL_OFFSET 0xE0000000
|
#define HOS_KERNEL_OFFSET 0xE0000000
|
||||||
|
|
||||||
#define PAGE_LOG_SIZE 12
|
#define PAGE_LOG_SIZE 12
|
||||||
@ -20,4 +24,8 @@ extern u8_t _end;
|
|||||||
#define KERNEL_VIRTUAL_ADDRESS (&_code)
|
#define KERNEL_VIRTUAL_ADDRESS (&_code)
|
||||||
#define KERNEL_SIZE ((&_end) - (&_code))
|
#define KERNEL_SIZE ((&_end) - (&_code))
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -2,6 +2,10 @@
|
|||||||
#ifndef HOS_TYPES_H
|
#ifndef HOS_TYPES_H
|
||||||
#define HOS_TYPES_H
|
#define HOS_TYPES_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef unsigned char u8_t;
|
typedef unsigned char u8_t;
|
||||||
typedef signed char s8_t;
|
typedef signed char s8_t;
|
||||||
typedef unsigned short u16_t;
|
typedef unsigned short u16_t;
|
||||||
@ -11,4 +15,8 @@ typedef signed int s32_t;
|
|||||||
typedef unsigned long long u64_t;
|
typedef unsigned long long u64_t;
|
||||||
typedef signed long long s64_t;
|
typedef signed long long s64_t;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -4,6 +4,10 @@
|
|||||||
|
|
||||||
#include "hos_types.h"
|
#include "hos_types.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
/* The magic number for the Multiboot header. */
|
/* The magic number for the Multiboot header. */
|
||||||
#define MB_HEADER_MAGIC 0x1BADB002
|
#define MB_HEADER_MAGIC 0x1BADB002
|
||||||
|
|
||||||
@ -142,4 +146,8 @@ typedef struct
|
|||||||
u16_t dseg_len;
|
u16_t dseg_len;
|
||||||
} mb_apm_t;
|
} mb_apm_t;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
#define MM_MAX_MMAP_ENTRIES 64
|
#define MM_MAX_MMAP_ENTRIES 64
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
pagedirectory_t page_directory __attribute__ ((aligned (4096)));
|
pagedirectory_t page_directory __attribute__ ((aligned (4096)));
|
||||||
|
|
||||||
static mm_mem_range_t mm_mmap_entries[MM_MAX_MMAP_ENTRIES];
|
static mm_mem_range_t mm_mmap_entries[MM_MAX_MMAP_ENTRIES];
|
||||||
@ -41,14 +43,17 @@ void mm_bootstrap()
|
|||||||
k_early_panic("No mmap entries read from bootloader!");
|
k_early_panic("No mmap entries read from bootloader!");
|
||||||
}
|
}
|
||||||
|
|
||||||
int mmap_idx, i;
|
for (int mmap_idx = 0; mmap_idx < mm_mmap_num_entries; mmap_idx++)
|
||||||
for (mmap_idx = 0; mmap_idx < mm_mmap_num_entries; mmap_idx++)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clear the page directory */
|
/* Clear the page directory */
|
||||||
for (i = 0; i < sizeof(page_directory) / sizeof(page_directory[0]); i++)
|
for (unsigned int i = 0;
|
||||||
|
i < sizeof(page_directory) / sizeof(page_directory[0]);
|
||||||
|
i++)
|
||||||
{
|
{
|
||||||
page_directory[i] = 0;
|
page_directory[i] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} /* extern "C" */
|
@ -6,6 +6,10 @@
|
|||||||
#include "hos_defines.h"
|
#include "hos_defines.h"
|
||||||
#include "multiboot.h"
|
#include "multiboot.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef u32_t pagedirectory_entry_t;
|
typedef u32_t pagedirectory_entry_t;
|
||||||
|
|
||||||
typedef pagedirectory_entry_t
|
typedef pagedirectory_entry_t
|
||||||
@ -22,5 +26,9 @@ typedef struct
|
|||||||
void mm_record_mmap_entry(mb_mmap_t * mmap);
|
void mm_record_mmap_entry(mb_mmap_t * mmap);
|
||||||
void mm_bootstrap();
|
void mm_bootstrap();
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user