pascal x C

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
andersonbuzzi
Posts: 1
Joined: Mon Oct 29, 2007 4:26 pm

pascal x C

Post by andersonbuzzi »

Hi,
i'm a brazilian programmer and i'm reading about OS development.
Initially, i write my own OS using asm and C. I write a lot of functions, and now I started a new OS using asm and Pascal (I prefer)...

My question: How can I use a function written in C in a pascal code?
I don't wanna write it again...
(I generated the .o file using: gcc -Wall -O -nostdlib -fno-builtin -fno-exceptions -I./include -c -o isrs.o isrs.c).

(Sorry for my english..)

Thanks!
ubergeek
Posts: 23
Joined: Thu Aug 09, 2007 5:26 am

Post by ubergeek »

You might want to check out the wiki page on Pascal. It has some info about interfacing with ASM, at least. C, I don't know, having no experience with pascal.
User avatar
inflater
Member
Member
Posts: 1309
Joined: Thu Sep 28, 2006 10:32 am
Location: Slovakia
Contact:

Post by inflater »

If you are using FP (its your only choice if you want to combine C into it, and if yer OS is 32bit), you can attach this into your function declaration:

function Blahblah(Foo: Integer); stdcall; [public, alias:'NameOfThisFunctionInGCC'];

Happy coding ;)

Regards
inflater
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English :P)
Post Reply