more x86_64 work. started to put the mmu bits together in the (former) stage2 loader.
[newos.git] / boot / pc / x86_64 / stage1.c
blobc5007ae90bfd0c601ed3b819b7f91b04aea40f9f
1 /*
2 ** Copyright 2001-2008, Travis Geiselbrecht. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
4 */
5 #include <string.h>
6 #include <stdarg.h>
7 #include <stdio.h>
8 #include <boot/stage2.h>
9 #include "stage2_priv.h"
10 #include "inflate.h"
12 extern void *_payload_start;
13 extern void *_payload_end;
14 #define TARGET ((void *)0x400000) // 4MB
16 void stage1_main(void *multiboot_info);
18 void stage1_main(void *multiboot_info)
20 unsigned long len;
22 clearscreen();
24 dprintf("stage1 boot\n");
26 dprintf("decompressing system, payload at %p...\n", &_payload_start);
27 len = gunzip((unsigned char const *)&_payload_start, TARGET, kmalloc(32*1024));
29 stage2_main(multiboot_info, 0, 0, 0);