GNU gclib
- kenneth_phough
- Member
- Posts: 106
- Joined: Sun Sep 18, 2005 11:00 pm
- Location: Williamstown, MA; Worcester, MA; Yokohama, Japan
- Contact:
GNU gclib
Would it be a huge burden to port gnu gclib to my OS? The reason I'm asking is because I'm having trouble with my home-made printf() function (called sysprint()) and I've read things about printf() that it uses other functions in the c library which make it hard to port so it's better to write your own, but I thought I might just port the whole thing.
Cheers,
Kenneth
Cheers,
Kenneth
http://www.cs.utah.edu/dept/old/texinfo ... .html#SEC3
here is the portability chapter.
On the same site go table of contents and you'll find anything you need
Best Regards
here is the portability chapter.
On the same site go table of contents and you'll find anything you need
Best Regards
I need someone to show me the things in life that I cant find
I cant see the things that make true happiness, I must be blind
I cant see the things that make true happiness, I must be blind
- carbonBased
- Member
- Posts: 382
- Joined: Sat Nov 20, 2004 12:00 am
- Location: Wellesley, Ontario, Canada
- Contact:
It might be worthwhile to check out other open source libc implementations before you make your decision.
For example, uClibc (http://uclibc.org/) and pdLibc (which, for the life of me, I can't currently find a link for... hopefully someone can add this in!). These implementations might be smaller/easier to port (ldLibc is not currently finished, however).
--Jeff
For example, uClibc (http://uclibc.org/) and pdLibc (which, for the life of me, I can't currently find a link for... hopefully someone can add this in!). These implementations might be smaller/easier to port (ldLibc is not currently finished, however).
--Jeff
- kenneth_phough
- Member
- Posts: 106
- Joined: Sun Sep 18, 2005 11:00 pm
- Location: Williamstown, MA; Worcester, MA; Yokohama, Japan
- Contact:
- kenneth_phough
- Member
- Posts: 106
- Joined: Sun Sep 18, 2005 11:00 pm
- Location: Williamstown, MA; Worcester, MA; Yokohama, Japan
- Contact:
trouble with compiling...
I'm trying to configure the glibc with i386-force_CPU386-none and it asks for the release number of my OS. So I enter what I think is the release number and says that it doesn't recognize it so it asks for the version number next, so I enter the version then it says that it has configured it. So I type make and wait for my computer to make the glibc files but its stops because of an error in start.s. I can't seem to figure out why this is happening, maybe because I entered the wrong release number. Would anyone know what might be the problem?
Thanks,
Kenneth
Thanks,
Kenneth
- kenneth_phough
- Member
- Posts: 106
- Joined: Sun Sep 18, 2005 11:00 pm
- Location: Williamstown, MA; Worcester, MA; Yokohama, Japan
- Contact:
your right...sorry about that, wasn't thinking.
the following are the errors I got:
as sysdeps/standalone/i386/start.s -o start.o
sysdeps/standalone/i386/start.s: Assembler messages:
sysdeps/standalone/i386/start.s:106: Warning: using `%cx' instead of `%ecx' due to `w' suffix
sysdeps/standalone/i386/start.s:144: Warning: using `%cx' instead of `%ecx' due to `w' suffix
sysdeps/standalone/i386/start.s:268: Error: junk at end of line, first unrecognized character is `¥'
sysdeps/standalone/i386/start.s:269: Error: bad or irreducible absolute expression
sysdeps/standalone/i386/start.s:269: Error: junk at end of line, first unrecognized character is `¥'
sysdeps/standalone/i386/start.s:270: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:273: Error: junk at end of line, first unrecognized character is `¥'
sysdeps/standalone/i386/start.s:274: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:284: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:285: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:287: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:288: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:298: Error: junk at end of line, first unrecognized character is `¥'
sysdeps/standalone/i386/start.s:299: Error: junk at end of line, first unrecognized character is `¥'
sysdeps/standalone/i386/start.s:300: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:301: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:302: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:304: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:305: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:307: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:308: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:309: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:310: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:312: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:313: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:321: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:322: Error: invalid character '_' in mnemonic
make: *** [start.o] Error 1
Thanks,
Kenneth
P.S. I was able to compile uClibc but I haven't tried it out with my OS yet so I'm not sure if it will work.
[EDIT] I failed to link uClibc to my OS
the following are the errors I got:
as sysdeps/standalone/i386/start.s -o start.o
sysdeps/standalone/i386/start.s: Assembler messages:
sysdeps/standalone/i386/start.s:106: Warning: using `%cx' instead of `%ecx' due to `w' suffix
sysdeps/standalone/i386/start.s:144: Warning: using `%cx' instead of `%ecx' due to `w' suffix
sysdeps/standalone/i386/start.s:268: Error: junk at end of line, first unrecognized character is `¥'
sysdeps/standalone/i386/start.s:269: Error: bad or irreducible absolute expression
sysdeps/standalone/i386/start.s:269: Error: junk at end of line, first unrecognized character is `¥'
sysdeps/standalone/i386/start.s:270: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:273: Error: junk at end of line, first unrecognized character is `¥'
sysdeps/standalone/i386/start.s:274: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:284: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:285: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:287: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:288: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:298: Error: junk at end of line, first unrecognized character is `¥'
sysdeps/standalone/i386/start.s:299: Error: junk at end of line, first unrecognized character is `¥'
sysdeps/standalone/i386/start.s:300: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:301: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:302: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:304: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:305: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:307: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:308: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:309: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:310: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:312: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:313: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:321: Error: invalid character '_' in mnemonic
sysdeps/standalone/i386/start.s:322: Error: invalid character '_' in mnemonic
make: *** [start.o] Error 1
Thanks,
Kenneth
P.S. I was able to compile uClibc but I haven't tried it out with my OS yet so I'm not sure if it will work.
[EDIT] I failed to link uClibc to my OS
- carbonBased
- Member
- Posts: 382
- Joined: Sat Nov 20, 2004 12:00 am
- Location: Wellesley, Ontario, Canada
- Contact:
You're not just trying to compile libc and link it into an app as stock, are you?
In any event, those assembler messages make me think your source file is corrupted... definitly doesn't seem right to have a yen symbol in the middle of your asm.
Is the file intact? What do the offending lines in the asm look like?
--Jeff
In any event, those assembler messages make me think your source file is corrupted... definitly doesn't seem right to have a yen symbol in the middle of your asm.
Is the file intact? What do the offending lines in the asm look like?
--Jeff
Here's something that might help:
http://my.execpc.com/~geezer/osd/libc/printf.c
http://my.execpc.com/~geezer/osd/libc/printf.c
- kenneth_phough
- Member
- Posts: 106
- Joined: Sun Sep 18, 2005 11:00 pm
- Location: Williamstown, MA; Worcester, MA; Yokohama, Japan
- Contact:
I don't see any ¥ sign in the source code start.s! Now, that's wierd.
I wonder if this is the source of the problem:
Because I haven't had the time to find an atheros wireless driver for my SuSE linux on my Toshiba I use my iBook to download soures, etc. and use my memory stick to move it over to my linux. Could this be the reason?
Also, when I checked start.s, I checked it in Xcode on my Mac and also with Kate on Linux.
@bubach
Thanks for the link! There is only one problem with that. When I compile my source code I tell gcc that there is no standard includes and that I have my own include files, so if I put #include <stdio.h> I would get an error saying no such file.
This is how I compile my source code:
for assembly files:
nasm -f aout mem.asm -o mem_a.o
c files:
gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -I./include -c -o kernel.o kernel.c
and I link them:
ld -T link.ld -o kernel.bin kernel_entry.o kernel.o screen.o message.o mem_a.o mem_c.o init.o gdt.o isr.o idt.o irq_a.o irq_c.o timer.o handler.o
*I don't know how I can link a standard library to my kernel.
Thanks,
Kenneth
I wonder if this is the source of the problem:
Because I haven't had the time to find an atheros wireless driver for my SuSE linux on my Toshiba I use my iBook to download soures, etc. and use my memory stick to move it over to my linux. Could this be the reason?
Also, when I checked start.s, I checked it in Xcode on my Mac and also with Kate on Linux.
@bubach
Thanks for the link! There is only one problem with that. When I compile my source code I tell gcc that there is no standard includes and that I have my own include files, so if I put #include <stdio.h> I would get an error saying no such file.
This is how I compile my source code:
for assembly files:
nasm -f aout mem.asm -o mem_a.o
c files:
gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -I./include -c -o kernel.o kernel.c
and I link them:
ld -T link.ld -o kernel.bin kernel_entry.o kernel.o screen.o message.o mem_a.o mem_c.o init.o gdt.o isr.o idt.o irq_a.o irq_c.o timer.o handler.o
*I don't know how I can link a standard library to my kernel.
Thanks,
Kenneth
- kenneth_phough
- Member
- Posts: 106
- Joined: Sun Sep 18, 2005 11:00 pm
- Location: Williamstown, MA; Worcester, MA; Yokohama, Japan
- Contact:
- carbonBased
- Member
- Posts: 382
- Joined: Sat Nov 20, 2004 12:00 am
- Location: Wellesley, Ontario, Canada
- Contact:
Sounds like it could be a line-end problem, then. Apple and Linux/Unix use different characters to terminate lines. When copying files to/from these OSs character 10 and 13 should be interchanged.kenneth_phough wrote:I don't see any ¥ sign in the source code start.s! Now, that's wierd.
I wonder if this is the source of the problem:
Because I haven't had the time to find an atheros wireless driver for my SuSE linux on my Toshiba I use my iBook to download soures, etc. and use my memory stick to move it over to my linux. Could this be the reason?
Also, when I checked start.s, I checked it in Xcode on my Mac and also with Kate on Linux.
Linux used to have utils called 'todos' and 'fromdos' which would change the EOL characters when converting to/from DOS (obv.)... there might also be utils 'tomac' and 'frommac' (or similar). If not... easy enough to write... or just use a search and replace from an editor.
What format filesystem is on the stick? Does Apple support auto-conversion of text files when copying from filesystem to filesystem? Linux does...
--Jeff
- kenneth_phough
- Member
- Posts: 106
- Joined: Sun Sep 18, 2005 11:00 pm
- Location: Williamstown, MA; Worcester, MA; Yokohama, Japan
- Contact: