Author
| SymbOS MSX multitasking operating system - help needed!
|
Edwin msx professional Posts: 620 | Posted: May 12 2006, 13:21   |
You can't do it for a running program directly, but you can start a new loader after you changed the address from autoxec.bas. (or the same loader if you do the move/run inside an if)
|
|
ARTRAG msx master Posts: 1686 | Posted: May 12 2006, 13:23   |
You can do more than this
if you move the basic program at C000h
using the pagemapper at 8000h you can
access to the full ram.
the steps are
run the autoexec.bas
your autoexec.bas move the basi at c000h
and load a loader.bas
the loader is loaded and executed at c000h
during its execution the loader load and swap
each page at 8000 untill alla the ram is full
|
|
AuroraMSX
 msx master Posts: 1249 | Posted: May 12 2006, 13:52   |
Quote:
| So how can I move the basic memory to #c000 (while the basic program is running)?
|
There's a system variable which indicates the starting address of BASIC. IIRC, it's at address #F676. So you could create a loader with a starting line like this:
5 ' Autoexec.bas
10 IF PEEK(&HF677)=&HC0 THEN 40
20 POKE &HC000,0: POKE &HC001,0: POKE&HF677,&HC0 ' Move BASIC to page 3
30 RUN"Autoexec.bas" ' reload and run myself at new BASIC start address
40 ' ...rest of program goes here...
You can of course combine lnes 10-30 into one oneliner.
This format gave me the opportuniy to include some useful (?) comments  |
|
Prodatron msx master Posts: 1109 | Posted: May 12 2006, 14:27   |
Thank you very much!  |
|
Prodatron msx master Posts: 1109 | Posted: May 13 2006, 15:16   |
Again a question regarding basic: If I use Auroras program, what is the maximum amount of bytes I can load with BLOAD (starting from #8000)? Seems that 31KB is too much.
|
|
Prodatron msx master Posts: 1109 | Posted: May 13 2006, 15:22   |
...and is there any chance to load data in basic somewhere between #0000 and #7fff??
|
|
Edwin msx professional Posts: 620 | Posted: May 13 2006, 15:45   |
16KB, which is the same as the page size. You can't load directly to the lower region from basic. However, there's no real need to because you can map the segments you loaded in page 0 & 1 just as easy as you do page 2 for loading.
|
|
Maggoo msx professional Posts: 584 | Posted: May 13 2006, 15:55   |
Quote:
| ...and is there any chance to load data in basic somewhere between #0000 and #7fff??
|
I would not bother loading from Basic. Why not starting from DOS/DOS2 ? There you have all the memory available from $100 to the top of the stack available and you can flip 16K pages a lot easier without caring about the ROM in lower pages... |
|
flyguille msx master Posts: 1202 | Posted: May 13 2006, 16:02   |
No chance, but you can split a big .BAS in two pages and withOUT a asm routine swap the pages you can do the trick.
if you do two basic's programs with the same firsts lines... so, that can be use as a table like a PUBLIC entrance to the program.... what i means
10 goto 10000
100 out &HFE,2:goto 20000
110 out &HFE,2:goto 21000
120 out &HFE,2:goto 22000
130 out &HFE,2:goto 23000
...
......
main program
other program can be:
10 goto 10000
100 out &HFE,1:goto 20000
110 out &HFE,1:goto 21000
120 out &HFE,1:goto 22000
130 out &HFE,1:goto 23000
so, each .BAS program must be start with the exact sames firsts lines. So in all programs the firts lines are locate in the same memory's position allowing that you can swap pages CLEAN, offcourse you needs to point the base's addr variable out of the page that will to swap.
so, with a single GOTO you are executing basic code in other page.
for to load
out &HFE,1
load "mainbas.bas"
out &HFE,2
poke &H8000,0:poke &H8001,0:poke &H8002,0 (IIRC)
load "addbas.bas"
....
out &HFE,1
run
that from a loader running at &HC000
|
|
Prodatron msx master Posts: 1109 | Posted: May 13 2006, 16:06   |
@Maggo: Yes, right, the final loader will start in DOS, currently I was just looking fo a fast quick and dirty solution 
@Edwin: Seems, that at least 20KB are possible. And yes, I will use mapping now! |
|
Prodatron msx master Posts: 1109 | Posted: May 13 2006, 16:08   |
Cool trick!
|
|
AuroraMSX
 msx master Posts: 1249 | Posted: May 13 2006, 16:32   |
Quote:
| No chance, but you can split a big .BAS in two pages and withOUT a asm routine swap the pages you can do the trick.
if you do two basic's programs with the same firsts lines... so, that can be use as a table like a PUBLIC entrance to the program...
|
That's a neat trick! /me impressed  |
|
ARTRAG msx master Posts: 1686 | Posted: May 13 2006, 17:33   |
@prodatron
you need to load 16K at time using pagemapping
try
5 ' Autoexec.bas
10 IF PEEK(&HF677)=&HC0 THEN 40
20 POKE &HC000,0: POKE &HC001,0: POKE&HF677,&HC0 ' Move BASIC to page 3
30 RUN"Autoexec.bas" ' reload and run myself at new BASIC start address
35 name$(1) ="file1":name$(2) ="file2": etc...
40 for n=1 to 7 ' up to 7 for 128K ram, up o 15 for 256K ram
50 out &HFE,n
60 bload name$(n)
70 next
In page 0 there is your basic program so bload on it at the very last
or leave it spare as working area |
|
Prodatron msx master Posts: 1109 | Posted: May 13 2006, 18:42   |
Thanx a lot! I already managed to load the complete SymbOS into the memory and start it without a crash  |
|
Prodatron msx master Posts: 1109 | Posted: May 13 2006, 19:05   |
This is, how it is currently looking:
As you can see, graphic output is not implemented, and I need to adjust the Y size of the desktop from 200 to 212. And of course much other things are still to do. But it's a nice beginning, I think
Currently the system manager process is disabled, as it is also responsible for disc I/O. What I would need during the next days are FDC routines (floppy disc controller). Does anyone have an idea, where I can get some standard ones (in BlueMSX I configured the standard MSX2 setting).
I need routines for sector read/write, get sector ID and track seeking, to be able to get the system and file manager up and running.
CU,
Prodatron
|
|
|
|
|