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 "libopenbios/console.h"
13 #include "asm/types.h"
15 #include "kernel/kernel.h"
16 #include "kernel/stack.h"
17 #include "drivers/drivers.h"
18 #include "drivers/pci.h"
19 #include "libopenbios/sys_info.h"
20 #include "libopenbios/video.h"
25 void collect_sys_info(struct sys_info *info);
27 #ifdef CONFIG_DRIVER_PCI
28 static const pci_arch_t default_pci_host = {
29 .name = "Intel,i440FX",
30 .vendor_id = PCI_VENDOR_ID_INTEL,
31 .device_id = PCI_DEVICE_ID_INTEL_82441,
36 static void init_memory(void)
38 /* push start and end of available memory to the stack
39 * so that the forth word QUIT can initialize memory
40 * management. For now we use hardcoded memory between
41 * 0x10000 and 0x9ffff (576k). If we need more memory
42 * than that we have serious bloat.
54 #ifdef CONFIG_DRIVER_PCI
55 arch = &default_pci_host;
58 #ifdef CONFIG_DRIVER_IDE
60 ob_ide_init("/pci/isa", 0x1f0, 0x3f6, 0x170, 0x376);
62 #ifdef CONFIG_DRIVER_FLOPPY
63 ob_floppy_init("/isa", "floppy0", 0x3f0, 0);
68 /* Force video to 32-bit depth */
69 VIDEO_DICT_VALUE(video.depth) = 32;
75 bind_func("platform-boot", boot );
76 bind_func("(go)", go );
79 extern struct _console_ops arch_console_ops;
83 #ifdef CONFIG_DEBUG_CONSOLE
84 init_console(arch_console_ops);
85 #ifdef CONFIG_DEBUG_CONSOLE_SERIAL
86 uart_init(CONFIG_SERIAL_PORT, CONFIG_SERIAL_SPEED);
88 /* Clear the screen. */
92 collect_sys_info(&sys_info);
94 dict = (unsigned char *)sys_info.dict_start;
95 dicthead = (cell)sys_info.dict_end;
96 last = sys_info.dict_last;
97 dictlimit = sys_info.dict_limit;
103 #ifdef CONFIG_DEBUG_CONSOLE_VGA
106 #ifdef CONFIG_DEBUG_BOOT
107 printk("forth started.\n");
108 printk("initializing memory...");
113 #ifdef CONFIG_DEBUG_BOOT
117 PUSH_xt( bind_noname_func(arch_init) );
118 fword("PREPOST-initializer");
120 PC = (ucell)findword("initialize-of");
123 printk("panic: no dictionary entry point.\n");
126 #ifdef CONFIG_DEBUG_DICTIONARY
127 printk("done (%d bytes).\n", dicthead);
128 printk("Jumping to dictionary...\n");
131 enterforth((xt_t)PC);