Re: loader and ficl/Forth help
- From: Jeremy Chadwick <koitsu@xxxxxxxxxxx>
- Date: Sun, 24 Feb 2008 12:03:05 -0800
On Sun, Feb 24, 2008 at 06:38:38PM +0100, Oliver Fromme wrote:
There's a debugging aid called "testmain" so you can run
Forth code interactively in multi-user mode for testing
purposes. For details please read the thread starting
here:
http://lists.freebsd.org/pipermail/freebsd-stable/2005-May/015387.html
Thanks! This helps a lot. I'm able to reproduce the sh_el not found
condition with testmain.
Personally I use qemu for testing loader things. I wrote
a trivial script that updates a small disk image and then
boot its in qemu, which only takes two or three seconds,
so testing cycles are pretty short.
Hmm, interesting software. I'm used to VMware myself, but this seems a
bit less bloated. I'd have to run it on Windows, since I don't use
FreeBSD as a workstation (no SDL, no VNC/X, etc.). The FreeBSD box in
my home runs Samba, so I should be able to set up a method of creating
ISO images of FreeBSD, which I can then test via qemu on Windows via
CIFS/SMB share...
I suggest you switch to ASCII characters automatically if
the loader is running on comconsole (i.e. serial), and use
CP437 it it is running on vidconsole (i.e. VGA). Then
there will be no need to manually switch a variable.
Great idea; I think I'll go with that.
I think the stack layout is not correct, particularly the
drops aren't quite right in some branches of the "if"
statements, I think. It's best to make a stack diagram
on paper and go through all possible branches with it.
I have a lot more reading to do on the subject of Forth. Stacks are
hardly a new concept to me, but the conditions where Forth puts
something onto the stack are. I've never worked with a language like
this before (at least RPN doesn't frustrate me!). I've already found
some reading material which should help.
s" loader_logo_lines" getenv
dup -1 = if
drop
s" arch-pc98" environment? if
drop
pc98_lines
else
cp437_lines
then
else
s" ascii" compare-insensitive 0= if
ascii_lines
else
cp437_lines
then
then
Again, thanks -- I don't quite understand the changes yet, but will
after I read aforementioned documents.
Sadly, the "sh_el not found" error still continues with this code -- but
it does fix the crashing I was seeing. I believe the problem is that
constants cannot be put inside of a function (functions being runtime
things, not compile-time things). Since the original code used
compile-time conditions ([if], etc.), it meant that only one declaration
for sh_el, sv_el, etc. was made.
Since the *_lines functions are doing the assignments, I had to change
them all to runtime, e.g.:
149 sh_el !
150 sv_el !
And so on, ditto with adding "variable sh_el", "variable sv_el" and
others to the very top of frames.4th. This actually fixed the "not
found" error, and now I'm stuck with "Error: compile only!" being
induced by the "dup -1 = if" line. The same happens when running this
natively (outside of testmain). I'll have to get the qemu stuff set up
so I can test this more easily.
--
| Jeremy Chadwick jdc at parodius.com |
| Parodius Networking http://www.parodius.com/ |
| UNIX Systems Administrator Mountain View, CA, USA |
| Making life hard for others since 1977. PGP: 4BD6C0CB |
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: loader and ficl/Forth help
- From: Jeremy Chadwick
- Re: loader and ficl/Forth help
- From: Oliver Fromme
- Re: loader and ficl/Forth help
- References:
- loader and ficl/Forth help
- From: Jeremy Chadwick
- Re: loader and ficl/Forth help
- From: Oliver Fromme
- loader and ficl/Forth help
- Prev by Date: Re: find -lname and -ilname implemented
- Next by Date: Re: Zeroing sensitive memory chunks [Was: Security Flaw in Popular Disk Encryption Technologies]
- Previous by thread: Re: loader and ficl/Forth help
- Next by thread: Re: loader and ficl/Forth help
- Index(es):
Relevant Pages
- Re: FreeBSD as VM host OS?
... OS speed at or close to native hardware speeds. ... *) jails provide virtual
hosting at native speed, but _only_ for FreeBSD ... Try qemu. ... what in
the world the patches may do if installed with other patches. ... (freebsd-questions) - Re: FreeBSD network stack Vs others
... I know that linux has had everything rewritten from scratch as far as the ...
Linux's tcp/ip stack has been rewritten many times over the years ... edge" of both systems,
FreeBSD and Linux, is about the same. ... was pretty much invented and developed on the
BSD operating system source ... (freebsd-net) - Re: FreeBSD network stack Vs others
... I know that linux has had everything rewritten from scratch as far as ... Linux's
stack hasn't been rewritten from the BSD one, ... edge" of both systems, FreeBSD
and Linux, is about the same. ... FreeBSD's TCP/IP stack is a descendant of the original
reference TCP/IP ... (freebsd-net) - Re: (Correction) Re: hiding OS name
... >>> there is anything out there for FreeBSD. ... >>> stack
to emulate other OS's, thus fooling these OS detection tools. ... TCP sequence prediction
is a completely ... >> IPID Sequence Generation: Randomized ... (FreeBSD-Security) - Re: coLinux - coFreeBSD available?
... > kqemu.ko is available and working (for Windows and FreeBSD). ...
awfully slow in there, especially when using remote desktop or graphics ... in the qemu
window. ... (comp.unix.bsd.freebsd.misc)