ppc64: Don't set Kp bit on SLB
[openbios/afaerber.git] / arch / x86 / boot.c
blobd40ab8c5b7fbb439c54de164d4d6e76341e0195c
1 /* tag: openbios boot command for x86
3 * Copyright (C) 2003-2004 Stefan Reinauer
5 * See the file "COPYING" for further information about
6 * the copyright and warranty status of this work.
7 */
9 #undef BOOTSTRAP
10 #include "config.h"
11 #include "libopenbios/bindings.h"
12 #include "arch/common/nvram.h"
13 #include "libc/diskio.h"
14 #include "libopenbios/sys_info.h"
15 #include "boot.h"
17 void go(void)
19 ucell address, type, size;
20 int image_retval = 0;
22 /* Get the entry point and the type (see forth/debugging/client.fs) */
23 feval("saved-program-state >sps.entry @");
24 address = POP();
25 feval("saved-program-state >sps.file-type @");
26 type = POP();
27 feval("saved-program-state >sps.file-size @");
28 size = POP();
30 printk("\nJumping to entry point " FMT_ucellx " for type " FMT_ucellx "...\n", address, type);
32 switch (type) {
33 case 0x0:
34 /* Start ELF boot image */
35 image_retval = start_elf(address, (uint32_t)&elf_boot_notes);
36 break;
38 case 0x1:
39 /* Start ELF image */
40 image_retval = start_elf(address, (uint32_t)NULL);
41 break;
43 case 0x5:
44 /* Start a.out image */
45 image_retval = start_elf(address, (uint32_t)NULL);
46 break;
48 case 0x10:
49 /* Start Fcode image */
50 printk("Evaluating FCode...\n");
51 PUSH(address);
52 PUSH(1);
53 fword("byte-load");
54 image_retval = 0;
55 break;
57 case 0x11:
58 /* Start Forth image */
59 PUSH(address);
60 PUSH(size);
61 fword("eval2");
62 image_retval = 0;
63 break;
66 printk("Image returned with return value %#x\n", image_retval);
70 void boot(void)
72 /* No platform-specific boot code */
73 return;