Michael
says:
Hey
Sriram says:
hi Micheal
Michael says:
So, are you still interested?
Sriram says:
yup
Sriram says:
but I am stuck up for the past couple of months with my job search
Michael says:
Okay
Sriram says:
so..please excuse me for another month..after which I shall catch up with you..
Sriram says:
but I am abreast with ur mails
Michael says:
Sure, we've just about come to the point of getting a test program with video
up and running.
Sriram says:
thats great
Michael says:
Do you know ASM?
Sriram says:
to a level...ok Motorola processors
Sriram says:
not quite comfortable with the Intel ones
Michael says:
Do you know anything about referencing asm from C using "extern" definitions?
Michael says:
In C that is...
Sriram says:
are u asking abt a variable in ASM
Michael says:
In C.
Michael says:
Like say I said: extern void clrscr()
Sriram says:
its easier if u embedded the same as a inline asm function
Michael says:
That's supposed to call the clrscr label in an ASM program.
Michael says:
Oh, ok.
Sriram says:
u can wrap the entire asm in a c function and comfortably call.. or you can
compile the asm file to a library(I am not sure how exactly u do it)...
Michael says:
Yeah, that's what I have to do.
Michael says:
Should of thought of that since I got this idea from "lib"dream...
Michael says:
Basically you need to use ASM libraries to access Dreamcast specific hardware,
stuff which isn't generic.
Sriram says:
oh..ok
Michael says:
So, what extension would a library have?
Michael says:
.lib ...
Sriram says:
under gcc u can compile as .so
Michael says:
Actually I think I know how to do that, Marcus included it with his video.s
example.
Sriram says:
then..cool
Michael says:
So after you've compiled it to .so, how do you link it into C?
Michael says:
Using the same "extern"?
Sriram says:
you can declare your function as extern and then while linking in gcc u can
include this library of yours using the -l extension
Sriram says:
gcc will search automatically
Michael says:
Oh, so when I compile the .c files I can use the -l extension to include any
libraries such as .so.
Sriram says:
it happens when u link the files
Sriram says:
u can include any library that exports a function
Michael says:
How do you do that?
Sriram says:
.o are static libraries and .so are shared libraries
Michael says:
Ok, the difference?
Sriram says:
in gcc and look for -L option
Michael says:
More than one .c file can use them?
Michael says:
Oh, so libraries are the object files?
Sriram says:
exactly
Michael says:
What's "elf"
Sriram says:
its a kind of method in which a object files parts are arranged
Sriram says:
u will get good tuts on this in the net
Sriram says:
its worth reading and knowing
Michael says:
Yeah
Sriram says:
u can slo rely on a book expert c programming...which teaches a lot of these
fundas well
Sriram says:
it will quite handy
Michael says:
I haven't done a lot of Unix C programming, mostly Microsoft.
Michael says:
Evil...
Sriram says:
I didnt get u ? EVIL?
Michael says:
Microsoft = EVIL
Sriram says:
exactly
Michael says:
I also noticed on Marcus's site that he has you convert a C file to .elf and
then to .bin. Do you know anything about this?
Sriram says:
.elf?
Michael says:
Yeah
Sriram says:
I havent done that..this might be a bit of cross compilation ..which I am not
quite sure of
Michael says:
Is .c to .elf the compilation stage, and .elf to .bin is just a conversion?
Sriram says:
u are right...
Sriram says:
.elf to .bin is after linking the program
Michael says:
Ok, so are linking and compiling the same command here?
Sriram says:
Compiling is the first step and linking the next
Michael says:
Here's what he tells me to do:
Michael says:
sh-elf-gcc -ml -Wl,-Ttext,0x8c010000 -nostartfiles -nostdlib -e _start prog.c
-o prog.elf -lgcc
Michael says:
sh-elf-objcopy -O binary prog.elf prog.bin
Michael says: -lgcc the library extension
Sriram says:
ya..cool
Sriram says:
no ..its a option
Sriram says:
I am not sure abt this option but a man gcc will tell u that
Michael says:
That's what I meant
Michael says:
I'll go look it up and dissect the command
Michael says:
So I'd compile the .s to .so and include them in the linking?
Sriram says:
ya..
Michael says:
Yeah, the linker is integrated into this command
Sriram says:
thats cool
Sriram says:
so is it working the way u need
Sriram says:
still there?
Sriram says:
hey..got to go..bye