22 March 2018, 01:37 | #1 |
Registered User
Join Date: Apr 2017
Location: Cambridge
Posts: 136
|
Kickstart 1.3 (v34) Execute without c:run
Hey all,
I'm sorry if I should have been able to Google any of this! First-up is there a good place to find docs/examples specific to the libraries present in Kickstart 1.3? I've been using amigadev.elowar.com but there's a lot of 2.0 only stuff in there which I'm getting caught-out by. Next-up is there any alternative to Execute under 1.3/v34 which doesn't require c:run to be available or run to be resident? If not is there any way to make run resident using the libraries in v34 before calling Execute if I have a copy which isn't under the c: assign? (I'd rather not mess with the c: assignment) There is CreateProc but that looks more low-level and I'm finding it hard to find examples (e.g. I assume I'd need to use the message port to send the new process some start-up messages and then wait for it's exit code on the port?) Any hints links appreciated |
22 March 2018, 19:19 | #2 | ||
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Quote:
Quote:
resident runwould make it resident. You can also do it programmatically by loading the program with LoadSeg()first, and then adding its segment pointer to the end of the list at DOSBase->dl_Root->rn_Info->di_NetHand. |
||
22 March 2018, 19:33 | #3 |
Registered User
Join Date: Apr 2017
Location: Cambridge
Posts: 136
|
Hey Leffmann,
Many thanks for the reply I'll have a hunt for that CD then! The later docs do indeed describe what is and isn't available or different under v34 but it's just a bit time consuming having so much decoy material Using LoadSegsounds very promising! I assume if I make it resident by adding it the the list you described I should either:
|
22 March 2018, 23:51 | #4 | ||
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Quote:
Quote:
LoadSeg()the program first, then allocate and fill in a struct Segmentand add that to the end of di_NetHand. You should only edit the list between a Forbid()-Permit()pair, and I'm guessing that to correctly remove the program you would unlink it first, then UnLoadseg(), and then deallocate the struct Segment. NDK 1.3 download: https://www.dropbox.com/s/5kougfenyw...ndk13.lha?dl=1 |
||
23 March 2018, 00:06 | #5 |
Registered User
Join Date: Apr 2017
Location: Cambridge
Posts: 136
|
Perfect thanks Leffmann
Downloaded the link and those hints should be enough to get me going thanks for pointing out Forbidand Permitbecause as a n00b I probably wouldn't have thought about that! |
15 April 2018, 01:08 | #6 |
Registered User
Join Date: Apr 2017
Location: Cambridge
Posts: 136
|
I just got around to trying what Leffmann suggested and it works great
But if I later do > resident run removethen the system crashes. Perhaps this is due to the way in which I've allocated the memory for the di_NetHandentry? (I don't know if that guess is correct, I'm at a loss) I used LoadSeg("run")and didn't call UnLoadSegat any point. For the di_NetHandentry I used AllocMem(16, 0)and I've tried changing the options there to things like MEMF_PUBLIC | MEMF_CHIPout of desperation. Any hints what might be wrong? |
15 April 2018, 10:27 | #7 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
struct Segment needs to be allocated like AllocVec() does (+4 length, first long contains size of allocation, return pointer to allocation + 4).
All dos allocations use this method, it is Tripos internal allocation method. |
15 April 2018, 18:01 | #8 |
Registered User
Join Date: Apr 2017
Location: Cambridge
Posts: 136
|
Many thanks Toni that's solved it
Is it just me or are the 1.3 ROM libraries a bit inconsistent and confusing (It's probably just me not reading the docs cover to cover) |
16 April 2018, 10:16 | #9 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
|
|
16 April 2018, 15:09 | #10 |
Registered User
Join Date: Apr 2017
Location: Cambridge
Posts: 136
|
Hey hooverphonique,
So what I understand so far is that:
SetPatchyourself the console output does in fact mention that it's patching Executeto use resident run. I think that Executealso doesn't inherit the current directory from the calling app in 1.3 (again might be wrong) which would mean that even if it looks someone else it's probably not going to look where you expect. I have to admit I've found this all very confusing! I think I'm half-way down a rabbit hole |
27 April 2018, 14:47 | #11 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
One more thing I have noticed: when emulating AllocVec and allocating the
struct Segment, the size must always be padded to a multiple of 4 bytes, or resident removewill trash the system. Probably because of all the BCPL legacy stuff in 1.3. |
28 April 2018, 23:30 | #12 |
Registered User
Join Date: Apr 2017
Location: Cambridge
Posts: 136
|
Thanks Leffmann,
I think I got lucky then since "run" as a BSTR ends-up being 4 bytes long |
28 April 2018, 23:40 | #13 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
|
|
29 April 2018, 12:15 | #14 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Oh the BSTR is a real thing and another BCPL legacy horror: a BCPL pointer to a BCPL-style string, which has a leading byte to indicate length rather than a trailing null-byte.
|
30 April 2018, 01:25 | #15 |
Registered User
Join Date: Apr 2017
Location: Cambridge
Posts: 136
|
Yup I did actually mean BSTR might be the first thing I've got right on my own!
Also, just to be clear for anyone else reading this thread, there is no pointer to a BCPL string here. Instead the structure is of variable length and the string is the tail end of it! So confusing |
30 April 2018, 10:58 | #16 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
|
I do know about BSTRs (they are used by Microsoft COM), but I didn't know they were related to BCPL - I probably should've guessed though
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
A500 Kickstart 2.04 won't run any disk | drfresh | support.Hardware | 3 | 29 December 2016 10:45 |
Execute file without using execute | VoltureX | support.Apps | 3 | 01 December 2011 09:59 |
I can't execute installer | paulo_becas | support.Apps | 5 | 01 March 2010 10:02 |
Execute Command Redirection Help | Ed Cruse | Coders. General | 2 | 30 September 2008 16:59 |
Execute a script | frikilokooo | project.ClassicWB | 6 | 20 November 2007 11:36 |
|
|