6 #include "libopenbios/bindings.h"
7 #include "arch/common/nvram.h"
8 #include "libc/diskio.h"
9 #include "libc/vsprintf.h"
10 #include "libopenbios/sys_info.h"
13 uint64_t kernel_image
;
15 uint64_t qemu_cmdline
;
16 uint64_t cmdline_size
;
19 extern int sparc64_of_client_interface( int *params
);
24 ucell address
, type
, size
;
27 /* Get the entry point and the type (see forth/debugging/client.fs) */
28 feval("saved-program-state >sps.entry @");
30 feval("saved-program-state >sps.file-type @");
32 feval("saved-program-state >sps.file-size @");
35 printk("\nJumping to entry point " FMT_ucellx
" for type " FMT_ucellx
"...\n", address
, type
);
39 /* Start ELF boot image */
40 image_retval
= start_elf(address
, (uint64_t)&elf_boot_notes
);
45 image_retval
= start_client_image(address
, (uint64_t)&sparc64_of_client_interface
);
49 /* Start a.out image */
50 image_retval
= start_client_image(address
, (uint64_t)&sparc64_of_client_interface
);
54 /* Start Fcode image */
55 printk("Evaluating FCode...\n");
63 /* Start Forth image */
71 printk("Image returned with return value %#x\n", image_retval
);
79 /* Copy the incoming path */
81 path
= pop_fstr_copy();
83 /* Boot preloaded kernel */
85 void (*entry
)(unsigned long p1
, unsigned long p2
, unsigned long p3
,
86 unsigned long p4
, unsigned long p5
);
88 printk("[sparc64] Kernel already loaded\n");
89 entry
= (void *) (unsigned long)kernel_image
;
90 entry(0, 0, 0, 0, (unsigned long)&sparc64_of_client_interface
);
93 /* Invoke Linux directly -- probably not supported */
95 /* No path specified, so grab defaults from /chosen */
100 fword("get-package-property");
102 path
= pop_fstr_copy();
105 param
= strchr(path
, ' ');
109 } else if (cmdline_size
) {
110 param
= (char *)qemu_cmdline
;
112 push_str("boot-args");
113 push_str("/options");
116 fword("get-package-property");
118 param
= pop_fstr_copy();
121 /* Invoke platform-specific Linux loader */
122 linux_load(&sys_info
, path
, param
);