Beginner Help - Print to screen

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
handyandy
Posts: 2
Joined: Tue Nov 14, 2006 2:50 pm

Beginner Help - Print to screen

Post by handyandy »

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.
Attachments
main.c
(744 Bytes) Downloaded 31 times
Last edited by handyandy on Tue Nov 14, 2006 3:12 pm, edited 1 time in total.
Lprogster
Member
Member
Posts: 174
Joined: Tue Nov 14, 2006 11:59 am

Post by Lprogster »

Sry I cant help... but Im interested in that tutorial, could you post the URL plz?
User avatar
Combuster
Member
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:

Post by Combuster »

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:

Code: Select all

void putch(char txt)
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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
handyandy
Posts: 2
Joined: Tue Nov 14, 2006 2:50 pm

Post by handyandy »

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.
Post Reply