kernel.img from hello world tutorial

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
binesh
Posts: 5
Joined: Thu Jul 03, 2014 5:40 pm

kernel.img from hello world tutorial

Post by binesh »

Hello all. Happy 4th of july :)


I have been trying out the tutorial that was provided for bare metal programming : [url]wiki.osdev.org/ARM_RaspberryPi_Tutorial_Cwiki.osdev.org/ARM_RaspberryPi_Tutorial_C.[/url]

When I make the files im getting errors on the flags that are in the make file. I tried compiling individually.I put all the functions of uart.c in main.c and compiled and linked the source files individually.But the kernel.img doesnt seem to work.Im getting only a rainbow screen when i boot up the rpi


Has anyone tried this tutorial and got the output. Can you please help me with it. Thanks. I appreciate it
User avatar
Lionel
Member
Member
Posts: 117
Joined: Fri Jul 16, 2010 2:16 pm
Libera.chat IRC: ryanel
Location: California

Re: kernel.img from hello world tutorial

Post by Lionel »

Excuse the rudeness, but you obviously did not read what a UART even is.
It is a serial device, not an output to the monitor. In other words it sends characters over serial, but does not send them to the monitor (there is no text mode like in x86 programming). To do that you need to learn about mailboxes and write a graphic terminal driver.
The rainbow screen is the expected output, as it's what the GPU is displaying by default. To get serial (UART) output from your Raspberry Pi, buy a GPIO to USB serial device and google how to connect it.

As for the flags causing errors, I can diagnose your problem: you haven't given me any information. You've given me your PC and then said "It's broken, fix it, bye" then left, leaving no explanation on what the problem is. Except in this case I can't look inside your PC as you are over the internet.

What compiler are you using, and what is the error?
I would also recommend you google "How to ask smart Questions" and read said document.
binesh
Posts: 5
Joined: Thu Jul 03, 2014 5:40 pm

Re: kernel.img from hello world tutorial

Post by binesh »

I am extremely sorry for being so blank. I completely understand your rudeness. Im from a different background and new to the field. I took this out of my own interest. And I should have known more about sending the characters to the screen through uart. Im sorry.


And I get the following errors when i make the files:


arm-none-eabi-gcc: fomit-frame-pointer: No such file or directory
cc1: error: unrecognized command line option "-Wno-unused-but-set-parameter"
cc1: error: unrecognized command line option "-Wno-unused-but-set-variable"
cc1: error: unrecognized command line option "-Wno-unused-result"
cc1: error: include: No such file or directory
make: *** [main.o] Error 1

I use the GNU toolchain given in the cambridge tutorial at http://www.cl.cam.ac.uk/projects/raspbe ... loads.html
Thanks
User avatar
iansjack
Member
Member
Posts: 4709
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: kernel.img from hello world tutorial

Post by iansjack »

I'm afraid that you are blindly following a tutorial without really understanding what you are doing or the tools that you are using. This means that when you come across an error in that tutorial you are unable to recognize it. In this case the (first) error is the omission of a hyphen before the switch "fomit-frame-pointer" in the Makefile. If you knew how to use GCC, and how to interpret its output, the error should be glaringly obvious.

I would recommend that before playing about with programming at this level you should learn how to use the assembler, C compiler, linker, and make utility by writing simple programs on your Pi. Once you are familiar with generating assembler and C programs you can make more sense of low-level programming.
binesh
Posts: 5
Joined: Thu Jul 03, 2014 5:40 pm

Re: kernel.img from hello world tutorial

Post by binesh »

thank you for the suggestion. I would do that. I thought of seeing the output and learning things from then on because it seemed interesting. I should have learnt before hand I guess. Thank you
binesh
Posts: 5
Joined: Thu Jul 03, 2014 5:40 pm

Re: kernel.img from hello world tutorial

Post by binesh »

can someone please tell me what all I need to learn and have understanding on, for this tutorial.. Im planning to get knowledge on this field through these tutorials.. suggestions on topics , links are welcomed...
Thanks :)
madanra
Member
Member
Posts: 149
Joined: Mon Sep 07, 2009 12:01 pm

Re: kernel.img from hello world tutorial

Post by madanra »

Required Knowledge is a good starting point.
Post Reply