
Tom Novelli's changes to Retro 6 build 1

Consider this an experiment.  I have Retro running under Linux, just barely,
without meeting all the goals listed below.  The Linux interface will
probably undergo drastic changes... but it's useful for kernel debugging, so
here it is.

To run the linux version:
	cd source
	. m.sh
	./rf


Goals:

1. Linux support
	Text console I/O: KEY EMIT BYE
	File I/O
	Signal handlers (to clean up after a crash)
	SVGALIB graphics initialization (link with a C file)
	Dynamic library loader - each lib in its own dictionary

	I see this as an experimental & transitional phase.. we can write
	programs using "real OS" functionality before we add it to native
	Retro.  We can get a better idea of what is and isn't needed from an
	OS, and only do what's needed when we add multitasking, memory
	management, files, libraries, etc. to Retro.  Bear in mind, Retro
	won't make it such a pain in the ass for programs to communicate!

2. Organization - Keep these things separate:
	Configuration (video mode, memory map)
	Bootup/Initialization (Raw, DOS, Linux)
	Drivers: keyboard, VGA+, IDE, files, Linux syscalls, etc.
	Drawing routines (text, 8, 16, 32-bit graphics)
	Extensions

	That way you could download ONLY the parts you need, for example:
	raw boot, keyboard, vga, 8-bit graphics, and a 3rd-party sound card
	driver.  Furthermore, when different platforms are supported we'll
	have to separate the shared Forth code from non-portable Forth code. 
	Retro kernels for different platforms should be independent
	projects, sharing a common dialect of Forth (more or less, depending
	on the platform's peculiarities.)

3. Spacewar :)



April 26, 2003
--------------
Added shell-script "m.sh" (builds forth/code.1)


April 30, 2003
--------------
Added a linux version, "linux.asm" (doesn't work yet)

Borrowed some macros I made up for IsForth to "automatically" create the
dictionary (no need for forth/dict.1).  They use the .text/.data sections,
and I thought NASM might balk at that when creating "binary" images, but it
does just fine... it puts .data after .text, which is just what I want.

New macros are:
	code 'forth-name', asm-name		(in Forth dict)
	macro 'forth-name', asm-name		(in Macro dict)
	var 'forth-name', asm-name, value

  VARIABLES WORK A BIT DIFFERENTLY NOW:
     This works fine, same as before: 
	mov ebx, [x]

     To CALL a variable as in Forth, add a '?' prefix.  Should almost
     never be necessary...
	call ?x

May 1, 2003
-----------
Moved forth/words/draw/ to drivers/g8/ (8-bit graphics primitives)
Created drivers/gtext (text "graphics", ie, EMIT, attributes, etc.)

Debugged:
	Dictionary macros
	KEY and EMIT for Linux
	WORDS

The Retro4 ColorForth-style interface doesn't really belong in the kernel. 
Might be handy for a 'calculator' program.
Removed: query_retro4, s, interface

May 2, 2003
-----------
Allocated H D TIB etc. in the .BSS section.. can't hardcode addresses in
Linux!  (Note- try to avoid hardcoding addresses even in the standalone
version; if you must, define them as an offset from START)

Cool! Managed to run 'startup.f' after these changes:
	Set 'offset' relative to 'h' instead of absolute address 1000
	Removed block & graphics words

And 'interpret' runs.. the Linux port is done!

Added a 'prompt' routine to be called from 'interpret'.. could print
'ok', a couple spaces, or whatever.

Moved IsForth dictionary macros into macros.1


May 3, 2003
-----------
Removed 'system' directory, moved header.1 and macros.1 up to main 'source'
directory.

Accidentally removed 'linux.asm' as I was cleaning up.. Doh!  Rewrote it in
about 10 minutes though.  Improved it a little, too.. I noticed that 'rp0'
and 'sp0' aren't actually used under Linux.. and I noted where each section
of code should be moved to once we get this thing organized..


Notes
-----
Terminal handling is still in linemode.. need to turn off ICANON and IECHO,
maybe do nonblocking I/O or select/poll, and add a signal handler to restore
the terminal state if you crash Forth.

To use SVGALIB, I can add an 'svga.c' driver to do the initialization and
such, then add 'svga.o -lc -lvga' to the 'ld' command line.  I'd use the
Retro drawing routines.

My changes broke the non-Linux console and disk drivers.. but I know they're
changing rapidly so I'm not gonna fix them in this version!
