10 July 2017, 16:35 | #1 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,643
|
Coding challenge: Maximize-contiguous-chipmem bootblock
From this simple question, I started thinking. While there are some commands you can add in startup-sequence, this fragments the precious contiguous chip RAM needed to squeeze in some games and demos on A500.
There have been a few bootblocks that have allowed the user to manually disable DF1 (and reboot), but it made me want to find out if there is a way to disable all external floppy drives, shrink the CLI window to, let's say, two lines of text high, and reduce it to one bitplane in depth, jerry-rigged by the bootblock before the startup-sequence. Previous solutions have not been compatible between Kickstarts. So is there a way which is compatible on all machines from kick 1.2 to 3.1? I'm posting here even though it's a boot block, because I think the focus is knowledge of the system. So if you want, give some ideas for the components, C, Assembler, or pseudocode - doesn't matter! |
10 July 2017, 19:47 | #2 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Nothing I've tried, but as for the diskdrives, one idea is to check io_Unit in your IOStdReq to see what drive you've booted from, then open disk.resource and check dr_Flags to see what other units are enabled, and call GetUnit() and FreeUnit() to disable them.
|
10 July 2017, 19:51 | #3 |
Going nowhere
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 9,014
|
Pretty sure Quartex did something like this from a bootblock (disable all external drives).
|
13 July 2017, 16:08 | #4 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,643
|
Thx Leffman!
Galahad - without rebooting tho? And compatible. If so then it could interesting to have a look if you can find it. The rebooting kind as you know is common, although I dunno many more than mine that are updated to be compatible. Toggle fastmem is easier to do without reboot. Anyway the thing would be to strip external drives and strip one bitplane (or "1.5") and carry on booting normally from Kick 1.2 up. |
14 July 2017, 15:05 | #5 |
Registered User
Join Date: May 2013
Location: Grimstad / Norway
Posts: 849
|
Isn't it possible to never have the CLI show? Or does 1.x always pop it up even if you redirect to NIL:?
|
14 July 2017, 20:12 | #6 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,483
|
Quote:
But... There is plenty of track loaders from Bootblock. In the last days i'm writing a file loader for non-system environment (yes, there are plenty also, but no one safe, small, functional and with good source code available). My code ended up as about $250 bytes (i will publish the source). With a little parser for startup-sequence we can 'emulate' everything from bootblock. Strange idea? Bye! ross |
|
14 July 2017, 20:31 | #7 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,347
|
You could experiment with SetFunction-ing OpenWorkBench or OpenScreen to change the depth used by the WB screen to 1.
(Somehow) patch the DOS CON handler to open the initial CLI window much smaller. Or maybe an OpenWindow patch would be simpler? |
14 July 2017, 21:17 | #8 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,350
|
You could just detach from CLI and call intuition.library/CloseWorkBench.
Using area $100-$3FF to move some code is possible as well ; from there you can run a small loader for whatever game or demo that follows. If the game does not use some libs you can perform RemLibrary() on them. Anyway, it all depends on what you really want to achieve. Is this purely academic or is there some specific goal ? Taking over the system might be a better solution for new games/demos needing lots of chipmem. |
15 July 2017, 13:13 | #9 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,347
|
Ah, if $100-$3FF are unused, you could copy any patch code there. And/or use AddMemList to add that small amount of memory to the system list. Make its priority one higher than chip RAM.
|
16 July 2017, 00:09 | #10 |
Registered User
Join Date: May 2013
Location: Grimstad / Norway
Posts: 849
|
You could relocate the header for chipmem to (fake) fastmem and then free it. That is some 16-32 bytes IIRC.
|
24 July 2017, 14:09 | #11 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,643
|
The goal is the same as for anyone who wants to release a DOS executable on floppy - demos, games, or just a DPaint/Protracker disk with as much chipmem free as possible. If you've done a good job and maximized use of chipmem, this could eliminate all manual handling. Like switching the DF1 to off with the switch on it, or do it by clicking in a bootblock, or click in ACA500 menu, etc.
So the CLI window should open, just smaller, and in 1 bitplane. Not opened big in 2 bitplanes and then re-allocated which while showing a higher number in Avail fragments the memory and is generally not usable. And the system should be prevented from allocating chip buffers for DF1-DF3 (or if already done, a way to unmount them and free the chip+fastmem used by them). |
24 July 2017, 14:23 | #12 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,350
|
Can we assume there is only chipmem in the system, or is moving things to other mem wishable ?
|
24 July 2017, 20:13 | #13 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,643
|
Well you couldn't move floppy buffers or bitplanes into fastmem anyway (or what do you mean?)
I just mean "click to disable DF1"+"Add21k", but do it automatically in the bootblock before running the startup-sequence. |
24 July 2017, 20:52 | #14 |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 828
|
You mean something like EndRun ?
|
24 July 2017, 21:23 | #15 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,643
|
Googled "endrun aminet", and that's the best I can do until you say what it is. It can't be an AmigaDOS program, obviously since it would likely be too late to reduce CLI colors (1.3) without fragmenting the chipmem like Add21k etc does.
|
24 July 2017, 22:10 | #17 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,350
|
If there is fastmem then it is fine to move the supervisor stack there, freeing a few kb (6k as of v39) that are located at the end of chipram (and therefore will add to the largest block).
|
25 July 2017, 11:58 | #18 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,634
|
I did a bootblock back in the day that let's you disable floppy drives - I'll see if I can remember to dig it up for you...
|
25 July 2017, 13:31 | #19 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,483
|
Quote:
In KS>=2.0 sstack is actually in real fastmem. The initial request is related to A500 so the stack moving is for quite rare situations. Bye ross |
|
25 July 2017, 17:51 | #20 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,350
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to maximize memory | jotd | support.Other | 3 | 27 November 2015 22:41 |
ChipMEM Bug. | FOL | support.WinUAE | 4 | 09 January 2013 22:41 |
Contiguous memory | Quiet_Man | New to Emulation or Amiga scene | 0 | 03 November 2011 08:53 |
Coding a bootblock | Yesideez | Coders. General | 15 | 23 May 2010 00:13 |
Apollo1260 + extra SIMM: contiguous RAM? (+ thank you Dimlow!) | Quagliarulo | support.Hardware | 10 | 10 April 2010 00:16 |
|
|