English Amiga Board Amiga Lore


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 10 July 2017, 16:35   #1
Photon
Moderator
Photon's Avatar
 
Join Date: Nov 2004
Location: Hult / Sweden
Posts: 4,437
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!
Photon is offline  
AdSense AdSense  
Old 10 July 2017, 19:47   #2
Leffmann

 
Join Date: Jul 2008
Location: Sweden
Posts: 2,010
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.
Leffmann is offline  
Old 10 July 2017, 19:51   #3
Galahad/FLT
Going nowhere

Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 44
Posts: 6,506
Pretty sure Quartex did something like this from a bootblock (disable all external drives).
Galahad/FLT is offline  
Old 13 July 2017, 16:08   #4
Photon
Moderator
Photon's Avatar
 
Join Date: Nov 2004
Location: Hult / Sweden
Posts: 4,437
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.
Photon is offline  
Old 14 July 2017, 15:05   #5
NorthWay
Registered User
 
Join Date: May 2013
Location: Grimstad / Norway
Posts: 362
Isn't it possible to never have the CLI show? Or does 1.x always pop it up even if you redirect to NIL:?
NorthWay is offline  
Old 14 July 2017, 20:12   #6
ross
Vae victis!

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Posts: 460
Quote:
Originally Posted by NorthWay View Post
Isn't it possible to never have the CLI show? Or does 1.x always pop it up even if you redirect to NIL:?
No, in 1.x is impossible to hide CLI.

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
ross is offline  
Old 14 July 2017, 20:31   #7
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,483
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?
mark_k is offline  
Old 14 July 2017, 21:17   #8
meynaf
68k wisdom
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon (France)
Age: 44
Posts: 2,372
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.
meynaf is offline  
Old 15 July 2017, 13:13   #9
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,483
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.
mark_k is offline  
Old 16 July 2017, 00:09   #10
NorthWay
Registered User
 
Join Date: May 2013
Location: Grimstad / Norway
Posts: 362
You could relocate the header for chipmem to (fake) fastmem and then free it. That is some 16-32 bytes IIRC.
NorthWay is offline  
Old 24 July 2017, 14:09   #11
Photon
Moderator
Photon's Avatar
 
Join Date: Nov 2004
Location: Hult / Sweden
Posts: 4,437
Quote:
Originally Posted by meynaf View Post
Is this purely academic or is there some specific goal ?
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).
Photon is offline  
Old 24 July 2017, 14:23   #12
meynaf
68k wisdom
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon (France)
Age: 44
Posts: 2,372
Can we assume there is only chipmem in the system, or is moving things to other mem wishable ?
meynaf is offline  
Old 24 July 2017, 20:13   #13
Photon
Moderator
Photon's Avatar
 
Join Date: Nov 2004
Location: Hult / Sweden
Posts: 4,437
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.
Photon is offline  
Old 24 July 2017, 20:52   #14
Asman
68k

Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 627
You mean something like EndRun ?
Asman is offline  
Old 24 July 2017, 21:23   #15
Photon
Moderator
Photon's Avatar
 
Join Date: Nov 2004
Location: Hult / Sweden
Posts: 4,437
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.
Photon is offline  
Old 24 July 2017, 22:00   #16
Asman
68k

Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 627
Sorry Photon I should at least point
link
In TheZone you can find executable.
Asman is offline  
Old 24 July 2017, 22:10   #17
meynaf
68k wisdom
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon (France)
Age: 44
Posts: 2,372
Quote:
Originally Posted by Photon View Post
Well you couldn't move floppy buffers or bitplanes into fastmem anyway (or what do you mean?)
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).
meynaf is offline  
Old 25 July 2017, 11:58   #18
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 692
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...
hooverphonique is offline  
Old 25 July 2017, 13:31   #19
ross
Vae victis!

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Posts: 460
Quote:
Originally Posted by meynaf View Post
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).
Hi meynaf, if KS<=1.3 and ranger ram present (the most common config.) supervisor stack it's not already in chip ram.
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
ross is offline  
Old 25 July 2017, 17:51   #20
meynaf
68k wisdom
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon (France)
Age: 44
Posts: 2,372
Quote:
Originally Posted by ross View Post
In KS>=2.0 sstack is actually in real fastmem.
Under V39 on my A1200 it's really in chip if i don't move it.
I suppose it's the same for other kick versions. If Exec is in chip, you've got big chances supervisor stack also is. And it is by default.
meynaf is offline  
AdSense AdSense  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 23:56.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.32602 seconds with 15 queries