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 "libopenbios/sys_info.h"
22 #define DICTIONARY_SIZE (256*1024) /* 256K for the dictionary */
23 static char intdict[DICTIONARY_SIZE];
25 static void init_memory(void)
27 /* push start and end of available memory to the stack
28 * so that the forth word QUIT can initialize memory
29 * management. For now we use hardcoded memory between
30 * 0x10000 and 0x9ffff (576k). If we need more memory
31 * than that we have serious bloat.
41 void setup_timers(void);
45 #ifdef CONFIG_DRIVER_IDE
47 ob_ide_init("/pci/pci-ata", 0x1f0, 0x3f6, 0x170, 0x376);
50 bind_func("platform-boot", boot );
53 extern struct _console_ops arch_console_ops;
57 #ifdef CONFIG_DEBUG_CONSOLE
58 init_console(arch_console_ops);
59 #ifdef CONFIG_DEBUG_CONSOLE_SERIAL
60 uart_init(CONFIG_SERIAL_PORT, CONFIG_SERIAL_SPEED);
62 /* Clear the screen. */
66 collect_sys_info(&sys_info);
69 dictlimit = DICTIONARY_SIZE;
71 load_dictionary((char *)sys_info.dict_start,
72 sys_info.dict_end-sys_info.dict_start);
77 #ifdef CONFIG_DEBUG_CONSOLE
80 #ifdef CONFIG_DEBUG_BOOT
81 printk("forth started.\n");
82 printk("initializing memory...");
87 #ifdef CONFIG_DEBUG_BOOT
91 PUSH_xt( bind_noname_func(arch_init) );
92 fword("PREPOST-initializer");
94 PC = (ucell)findword("initialize-of");
97 printk("panic: no dictionary entry point.\n");
100 #ifdef CONFIG_DEBUG_DICTIONARY
101 printk("done (%d bytes).\n", dicthead);
102 printk("Jumping to dictionary...\n");
105 enterforth((xt_t)PC);