I have just started to write my own os tonight and I having trouble...
Im using GRUB to boot with. I borrowed basic code to get text onto the screen.
I am using the code off osdever.net called bkerndev.zip.
when I try to compile with gcc with these command line arguments:
gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -c -o main.o main.c
gcc returns the error:
invalid operands to binary |
the code it is having problems with is
*where = txt | att;
att is the colour.
This works fine in the example I am using.
I have included the main.c file as an attachment.
Thanks in advance.
Beginner Help - Print to screen
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
I get two errors: both are about comparing a pointer to an integer.
What is wrong is that the definition of putch requires a char * instead of a char. (As well as the fact that you are supplying strings instead of characters)
Here, the correct definition (IIRC in the C99 standard its char c) should be:
Since that error also came by recently, i think the tutorial has some issues. However I dont know where it comes from...
the wiki page is hopefully just as educating and bugfree.
What is wrong is that the definition of putch requires a char * instead of a char. (As well as the fact that you are supplying strings instead of characters)
Here, the correct definition (IIRC in the C99 standard its char c) should be:
Code: Select all
void putch(char txt)
the wiki page is hopefully just as educating and bugfree.
Thanks lprogster and combuster. Here is the url of that tutorial:
http://www.osdever.net/bkerndev/index.php?the_id=90
if you go right to the end then you cna download the completed working version.
http://www.osdever.net/bkerndev/index.php?the_id=90
if you go right to the end then you cna download the completed working version.