More updates to baremetal environment
This commit is contained in:
parent
11112ed2f0
commit
06cfe06866
5 changed files with 17 additions and 8 deletions
|
|
@ -5,7 +5,7 @@ CC = gcc
|
|||
|
||||
CFLAGS = -I ../include -I ../include/$(ARCH) -O2 -DZKERNEL_START=0xfff00000
|
||||
|
||||
DEPS = bootselect.o rom_fill_inbuf.o chooser.o ../lib/baremetal.a
|
||||
DEPS = ../lib/_main.o bootselect.o rom_fill_inbuf.o chooser.o ../lib/baremetal.a
|
||||
|
||||
bootselect.elf: $(DEPS)
|
||||
ld -defsym HEAPSIZE=0x8000 -T elfImage.lds $(DEPS) -o bootselect.elf
|
||||
|
|
|
|||
|
|
@ -15,13 +15,12 @@
|
|||
#include <printk.h>
|
||||
#include <rom/read_bytes.h>
|
||||
#include <boot/elf.h>
|
||||
#include <preboot.h>
|
||||
|
||||
|
||||
#define DPRINTF( x... )
|
||||
//#define DPRINTF printk
|
||||
|
||||
extern struct lb_memory *get_lbmem(void);
|
||||
|
||||
char buffer[16];
|
||||
|
||||
extern struct stream rom_stream;
|
||||
|
|
@ -34,14 +33,12 @@ int main(void) {
|
|||
while(1) {
|
||||
printk("Welcome to the LinuxLabs boot chooser!\n");
|
||||
|
||||
lbmem = get_lbmem();
|
||||
|
||||
DPRINTF("Got lbmem struct: %08x\n", (unsigned int) lbmem);
|
||||
|
||||
if(choose_stream(&rom_stream) <0)
|
||||
return(-1);
|
||||
|
||||
elfboot(&rom_stream, lbmem);
|
||||
elfboot(&rom_stream, preboot_param);
|
||||
}
|
||||
|
||||
outb(0x0e, 0x3f9);
|
||||
|
|
|
|||
|
|
@ -8,11 +8,12 @@ OUTPUT_ARCH(i386)
|
|||
|
||||
HEAPSIZE = DEFINED(HEAPSIZE) ? HEAPSIZE : 0x8000;
|
||||
|
||||
ENTRY(main)
|
||||
ENTRY(_main)
|
||||
SECTIONS
|
||||
{
|
||||
/* . = 0x10000 - (elf_note - elf_header); */
|
||||
. = 0x1000;
|
||||
/* . = 0x20000000; */
|
||||
. = 0x20000;
|
||||
_text = .; /* Text and read-only data */
|
||||
.text . : {
|
||||
*(.text)
|
||||
|
|
|
|||
|
|
@ -10,4 +10,13 @@ typedef struct pre_boot_param {
|
|||
struct lb_memory *lbmem;
|
||||
} __attribute__ ((packed)) pre_boot_param_t;
|
||||
|
||||
|
||||
extern struct lb_memory *lbmem;
|
||||
extern struct lb_memory *get_lbmem(void);
|
||||
|
||||
extern unsigned long int preboot_ramtop;
|
||||
extern pre_boot_param_t *preboot_param;
|
||||
|
||||
extern int main();
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ LB_SOURCE=../../../src
|
|||
|
||||
DEPS = printk.o serial_subr.o subr.o vsprintf.o memcpy.o malloc.o memset.o compute_ip_checksum.o elfboot.o boot.o ide.o linuxbios.o delay_tsc.o
|
||||
|
||||
all: baremetal.a _main.o
|
||||
|
||||
baremetal.a : $(DEPS)
|
||||
ar -cr baremetal.a $(DEPS)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue