c,filesystem..
Posted: Fri Aug 23, 2002 12:17 pm
Hi,
I've got a few "problems".
this code creates a big binary, 'cause I set c to 5.
gcc adds a lot of "add [eax],al" commands to my code instead of using the code segment, how do I change that?
(a c code without char c=5; function works fine...)
I'm using this compile line:
Also,
how do I create a file system?
for example:
I wrote an header which can write and read sectors of the disk,
so how do I open file?...
the files start at the end of the disk,
if you read a file, how does it know which disk it should use,
and how does it get the sector data from the disk? (the filesytem)
I've got a few "problems".
Code: Select all
asm("jmp start");
char c=5;
void start()
{
while (1)
{
}
}
gcc adds a lot of "add [eax],al" commands to my code instead of using the code segment, how do I change that?
(a c code without char c=5; function works fine...)
I'm using this compile line:
Code: Select all
gcc -o4 -c kern.c
ld -o kern -Ttext 0x1000 -Tdata 0x1200 -e 0x0 -N kern.o
objcopy -R .note -R .comment -S -O binary kern kern.bin
Also,
how do I create a file system?
for example:
I wrote an header which can write and read sectors of the disk,
so how do I open file?...
the files start at the end of the disk,
if you read a file, how does it know which disk it should use,
and how does it get the sector data from the disk? (the filesytem)