1 /* tag: openbios forth environment, executable code
3 * Copyright (C) 2003 Patrick Mauritz, Stefan Reinauer
5 * See the file "COPYING" for further information about
6 * the copyright and warranty status of this work.
10 #include "libopenbios/openbios.h"
11 #include "libopenbios/bindings.h"
12 #include "asm/types.h"
14 #include "kernel/kernel.h"
15 #include "kernel/stack.h"
16 #include "drivers/drivers.h"
17 #include "drivers/pci.h"
18 #include "libopenbios/sys_info.h"
23 void collect_sys_info(struct sys_info
*info
);
25 #ifdef CONFIG_DRIVER_PCI
26 static const pci_arch_t default_pci_host
= {
27 .name
= "Intel,i440FX",
28 .vendor_id
= PCI_VENDOR_ID_INTEL
,
29 .device_id
= PCI_DEVICE_ID_INTEL_82441
,
34 static void init_memory(void)
36 /* push start and end of available memory to the stack
37 * so that the forth word QUIT can initialize memory
38 * management. For now we use hardcoded memory between
39 * 0x10000 and 0x9ffff (576k). If we need more memory
40 * than that we have serious bloat.
52 #ifdef CONFIG_DRIVER_PCI
53 arch
= &default_pci_host
;
56 #ifdef CONFIG_DRIVER_IDE
58 ob_ide_init("/pci/isa", 0x1f0, 0x3f4, 0x170, 0x374);
60 #ifdef CONFIG_DRIVER_FLOPPY
61 ob_floppy_init("/isa", "floppy0", 0x3f0, 0);
64 init_video(phys_to_virt(0x3C00000), 640, 480, 32, 2560);
68 bind_func("platform-boot", boot
);
69 bind_func("(go)", go
);
74 #ifdef CONFIG_DEBUG_CONSOLE
75 #ifdef CONFIG_DEBUG_CONSOLE_SERIAL
76 uart_init(CONFIG_SERIAL_PORT
, CONFIG_SERIAL_SPEED
);
78 /* Clear the screen. */
82 collect_sys_info(&sys_info
);
84 dict
= (unsigned char *)sys_info
.dict_start
;
85 dicthead
= (cell
)sys_info
.dict_end
;
86 last
= sys_info
.dict_last
;
87 dictlimit
= sys_info
.dict_limit
;
93 #ifdef CONFIG_DEBUG_CONSOLE_VGA
96 #ifdef CONFIG_DEBUG_BOOT
97 printk("forth started.\n");
98 printk("initializing memory...");
103 #ifdef CONFIG_DEBUG_BOOT
107 PUSH_xt( bind_noname_func(arch_init
) );
108 fword("PREPOST-initializer");
110 PC
= (ucell
)findword("initialize-of");
113 printk("panic: no dictionary entry point.\n");
116 #ifdef CONFIG_DEBUG_DICTIONARY
117 printk("done (%d bytes).\n", dicthead
);
118 printk("Jumping to dictionary...\n");
121 enterforth((xt_t
)PC
);