RetroForum Welcome, Guest. Please login or register.
September 09, 2010, 11:02:15 PM
Home Help Search Calendar Login Register

RetroForth Discussion  |  Older Boards  |  Development  |  Topic: Add new word to retroforth « previous next »
Pages: 1 Go Down Print
Author Topic: Add new word to retroforth  (Read 2491 times)
borisman
Member
**

Karma: +0/-0
Offline Offline

Posts: 6


View Profile
Add new word to retroforth
« on: July 19, 2005, 07:21:45 AM »

Hi everybody.

I'm trying to improve native RetroForth little bit. I want to make boot loader tell core from what drive it was booted up. For doing this, i need to add new word to the core (either variable or constant (better) )

I've added var marco call in core.asm:
; --------------------------------------------------------------
var 'h0', h, h0              ; h0     (pointer to HERE)
var 'base', base, 10           ; base   current numeric base
var '>in', tin, 0           ; >IN    Pointer into the TIB
var 'word?', notfound, 0   ; ?word  Handler for errors
var 'bootd', bootdr, 0 ; <- i added this

And vdev call in core.dict:
vdef 'h0', h, h0              ; h0     (pointer to HERE)
vdef 'base', base, 10           ; base   current numeric base
vdef '>in', tin, 0           ; >IN    Pointer into the TIB
vdef 'word?', notfound, 0   ; ?word  Handler for errors
vdef 'bootd', bootdr, 0 ; <- i added this

After compile, retroforth starts and crashes. Depending on the initial value (0 or some other) it behaves differently, but very strangely  - for example, starts editor right after loading, puts some values on data stack...

What i do wrong ?

Logged
borisman
Member
**

Karma: +0/-0
Offline Offline

Posts: 6


View Profile
Re: Add new word to retroforth
« Reply #1 on: July 19, 2005, 12:09:24 PM »

Also, for some reason, if i add a single byte to the source blocks, for example, add any text output (even in welome) like this:

." RetroForth 8.0  ::  Visit http://www.retroforth.org for updates" cr cr
." GOGOGO " | <- i added this

then compiled image crashes.
Logged
borisman
Member
**

Karma: +0/-0
Offline Offline

Posts: 6


View Profile
Re: Add new word to retroforth
« Reply #2 on: July 19, 2005, 12:28:49 PM »

Even if i just add spaces or lines to any of the source blocks, the same problem.

I use development version rf8-dev-native.zip, because release version does not work for the same reasons i think.
Logged
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Re: Add new word to retroforth
« Reply #3 on: July 19, 2005, 08:25:59 PM »

There seems to be a bug arising when execution of the bootstrap code reaches source/blocks/edit (the final bit of code). I'm looking into this.
« Last Edit: July 20, 2005, 12:46:15 AM by Charles Childers » Logged
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Re: Add new word to retroforth
« Reply #4 on: July 20, 2005, 01:14:48 AM »

Ok, it should work now. The bug was a problem with the boot sector. (It was loading the first 17 sectors, or 8,704 bytes. It now loads 30 sectors, for a maximum size of 15,360 bytes)

This should be enough, at least for a while. Thank you for discovering this and alerting me!
Logged
borisman
Member
**

Karma: +0/-0
Offline Offline

Posts: 6


View Profile
Re: Add new word to retroforth
« Reply #5 on: July 22, 2005, 10:51:04 AM »

Ok, it should work now. The bug was a problem with the boot sector. (It was loading the first 17 sectors, or 8,704 bytes. It now loads 30 sectors, for a maximum size of 15,360 bytes)
Yeah, you're right, i've discovered that by myself after a day of stupid hacking Smiley
By the way, i think this is not a bug, this is intentional. Let everybody choose bootstrap blocks they need to fit into 17 sectors and load other code from blocks.
But, currently retroforth can't really work with blocks either Sad It has blockio that works with IDE drives only. This is stopping me little bit.
Also, using protected mode is a questionable thing, because nobody can use BIOS calls anymore. And providing disk access implementation for each drive (IDE, FDD, SCSI) is little bit scary.
Can we implement real mode callback for calling BIOS Huh
This should be enough, at least for a while. Thank you for discovering this and alerting me!
O, i think you already knew about this, because bootstrap code is optimized so that it fits EXACTLY in 17 sectors. This should be intentional.
Logged
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Re: Add new word to retroforth
« Reply #6 on: July 22, 2005, 11:25:01 PM »

Well, I am going to leave the upper limit at 30 sectors. (This will be needed for some people, especially if they require larger drivers to boot and make use of their hardware.)

ATA/IDE drives are all I have. The driver should work with Serial ATA (sata) as well though. SCSI is harder since there are various formats. I also lack any systems that use SCSI drives.

I'll see what I can do to enable BIOS interrupts. Making sure that nothing gets corrupted in the pmode->rmode switch, and during the BIOS call will be tricky, but is doable. We'll see. (Anybody with experience doing this is welcome to help!)
Logged
Pages: 1 Go Up Print 
RetroForth Discussion  |  Older Boards  |  Development  |  Topic: Add new word to retroforth « previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1 RC2 | SMF © 2001-2005, Lewis Media Valid XHTML 1.0! Valid CSS!