Bona Fide OS Developer
View unanswered posts | View active topics It is currently Fri Nov 24, 2017 4:48 pm



Post new topic Reply to topic  [ 67 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7
 How do i get my kernel to load binary programs? 
Author Message

Joined: Sat Jul 25, 2009 9:15 am
Posts: 257
Post Re: How do i get my kernel to load binary programs?
well you have quite a dilema cause BASM and TC won't make a far without complaining, you need to change both CS and IP and to do that is to do a far CALL or JMP... BASM seems to only want to jump to labels created within TC so I don't see a way out...

external assembly was the only way I found... dunno what else to tell ya...


Sat Oct 10, 2009 6:17 pm
Profile

Joined: Sat Jul 25, 2009 9:15 am
Posts: 257
Post Re: How do i get my kernel to load binary programs?
I have a trick up my sleeve that may eliminate the need for exec.asm

make a near call from TC and in stub.asm a.k.a call.asm you issue a far JMP to an address close by that would correct the values of CS and IP and when main returns you make CS and IP back the way it was...

but that is clearly a hack and TC, BASM, TASM and TLINK have all proven effective at ruining something somewhere... anywho I'll try that after the weekend...


Sat Oct 10, 2009 6:54 pm
Profile
Post Re: How do i get my kernel to load binary programs?
FIXED IT!
i had to change the
Code:
extern pascal int exec(char *);

to
Code:
extern "C" pascal int exec(char *);

shit yeah!


Sat Oct 10, 2009 7:37 pm

Joined: Sat Jul 25, 2009 9:15 am
Posts: 257
Post Re: How do i get my kernel to load binary programs?
huh what does the "C" mean???
"C" calling convention??
is it possible to have a hybrid pascal+C calling convention??

I don't quite remember well but I believe that it might be possible to specify the OBJ file inside the souce code... but I don't remember if that was turbo pascal or turbo C


Sat Oct 10, 2009 8:13 pm
Profile
Post Re: How do i get my kernel to load binary programs?
it works but freezes on return


Sat Oct 10, 2009 9:18 pm
Post Re: How do i get my kernel to load binary programs?
GOT IT!
i have to end the child with retf not ret
thank you thank you thank you thank you


Sat Oct 10, 2009 9:22 pm
Post Re: How do i get my kernel to load binary programs?
heres the catch
now all the external kernel calls have to return far


Sat Oct 10, 2009 9:49 pm
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 67 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin and tweaked by the BF Team.