View Single Post
Old 25 March 2010, 20:06   #162
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by zaz View Post
372 bytes now.
Cool! Gotta check your version in a sec! "I'm a bit rusty", yeah, right. ;P

Quote:
Originally Posted by zaz View Post
But what happens if $60000 is allocated already? Even with AllocAbs() the loader will fail if that happens...
This is a very "dirty" solution anyway which I really do not like. However, in case of using AllocAbs you could call AllocAbs in a loop until it succeeds. F.e. $40000 first, fails -> increase by say $1000 bytes -> loop

Quote:
Originally Posted by zaz View Post
After the system is killed we could copy the loader to $c0 or some low address and just assume the bootblock is not loaded there (like with the stack relocations), but then it's no longer safe to use library calls to flush the cache...
This is the same as my "copy to $60000" approach then (as I also assume that the bootblock isn't loaded there, AFAIK OS loads bootblock quite low into memory). Cleanest approach would be to call AllocMem and copy the code then (I used exactly that approach in the Bootblock intro I made for FAP) but then the stack relocation wouldn't be safe anymore which is why I didn't use it.
StingRay is offline  
 
Page generated in 0.04359 seconds with 11 queries