Go to advanced search

by badut
Wed Oct 03, 2012 12:06 am
Forum: Bare metal, Assembly language
Topic: Cambridge OS tutorial
Replies: 12
Views: 3392

Re: Cambridge OS tutorial

The source directory is at the same level as the makefile.

One thing you could try is to download the solution to observe how Alex has set up the directory structure.
by badut
Tue Sep 25, 2012 5:45 pm
Forum: Bare metal, Assembly language
Topic: Linker script
Replies: 1
Views: 1778

Linker script

Starting from Input01, Alex's kernel.ld looks like this: SECTIONS { /* * First and formost we need the .init section, containing the IVT. */ .init 0x0000 : { *(.init) } = 0x3F3F3F3F /* * Next we put the data. */ .data 0x8080 : { *(.data) *.c.o(*) } = 0x3F3F3F3F /* * We allow room for the ATAGs and t...
by badut
Tue Sep 25, 2012 5:07 pm
Forum: Bare metal, Assembly language
Topic: Registers at kernel startup
Replies: 11
Views: 2579

Re: Registers at kernel startup

Turns out the problem wasn't in the way I stored or loaded those registers. All I did to make it work was to update to the latest firmware. (This necessitated a rebuild due to moving stuff around in kernel.ld ie. init section was moved to 0x8000 and kernel_old is off) :? So either the firmware chang...
by badut
Tue Sep 25, 2012 3:34 pm
Forum: Bare metal, Assembly language
Topic: Beginning with Bare Metal
Replies: 52
Views: 19590

Re: Beginning with Bare Metal

I added more to the end of my bare metal tutorial. Covered some gotchas that will make for quite a bit of pain when trying to mix arm and thumb code. David Thanks for that tutorial David. I'm half way through reading it and I've learned a few things already. :) I'll be going through some of your ex...
by badut
Sun Sep 23, 2012 11:33 pm
Forum: Bare metal, Assembly language
Topic: Registers at kernel startup
Replies: 11
Views: 2579

Re: Registers at kernel startup

The above is how you store them, how are you retrieving them ? Good question, I should've included that in the original post. I'm loading the values back from memory and comparing them with what I think the values should be. If it matches my expectation, I print a string. I'm expecting r0==0, r1!=0...
by badut
Sat Sep 22, 2012 1:22 pm
Forum: Bare metal, Assembly language
Topic: Registers at kernel startup
Replies: 11
Views: 2579

Registers at kernel startup

Hi all, According to this document http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html when the kernel starts up, r0 should be zero, r1 contains the machine type, r2 contains the address of the ATAGs. Does the RPi firmware adhere to these rules? I find r0 is not zero and r2 is not 0x...
by badut
Thu Sep 20, 2012 1:03 am
Forum: Bare metal, Assembly language
Topic: Screen02 - variable bit depth
Replies: 6
Views: 3726

Re: Screen02 - variable bit depth

Thank you, that does help :D
by badut
Thu Sep 20, 2012 12:47 am
Forum: Bare metal, Assembly language
Topic: Baking Pi OK04 - Wait function
Replies: 11
Views: 3183

Re: Baking Pi OK04 - Wait function

In your code below, what is pTimerCount? is that a global declared somewhere or a typo? &'ing it with 0xFFFFFFFF doesn't do anything. dword _getCurrentTimerValue() { dword *pTimerCountLO; dword currentCount; pTimerCountLo = (dword *)TIMER_BASE_ADDRESS + 0x04; currentCount = (dword)(*pTimerCount & 0x...
by badut
Wed Sep 19, 2012 1:40 am
Forum: Bare metal, Assembly language
Topic: Screen02 - variable bit depth
Replies: 6
Views: 3726

Re: Screen02 - variable bit depth

Thanks DexOS, I'm not sure I understand everything on that page. Trying to picture what the request and response buffers would look like for a "Get pixel order" tag. Request: u32: 0x0000001c // Size of the entire request buffer u32: 0x00000000 // buffer request code u32: 0x00040006 // ie, the tag id...
by badut
Tue Sep 18, 2012 9:45 pm
Forum: Bare metal, Assembly language
Topic: Screen02 - variable bit depth
Replies: 6
Views: 3726

Screen02 - variable bit depth

I've been trying to extend Alex's screen02 by adding the ability to use bit depths other than high colour. So far, I've had limited success. I can't get low colour or RGBA to draw anything at all. High colour draws fine but true colour seems to have the red and blue channels reversed. This sounds li...
by badut
Tue Sep 18, 2012 12:57 am
Forum: Bare metal, Assembly language
Topic: Troubles with INCBIN
Replies: 17
Views: 3914

Re: Troubles with INCBIN

Hi Sepherion, i noticed that you have a .align 12 before you .section .text in your drawing.s (line 37)
Why do you do that?
(no idea if that's right or wrong, just curious) :D
by badut
Sun Sep 16, 2012 1:03 am
Forum: Bare metal, Assembly language
Topic: Baking Pi Screen02 - waiting for pointer to framebuffer
Replies: 5
Views: 2558

Re: Baking Pi Screen02 - waiting for pointer to framebuffer

thanks, so .align 4 is correct then as that means 2^4?
by badut
Sat Sep 15, 2012 1:44 pm
Forum: Bare metal, Assembly language
Topic: Baking Pi Screen02 - waiting for pointer to framebuffer
Replies: 5
Views: 2558

Baking Pi Screen02 - waiting for pointer to framebuffer

Hi all, screen01 worked for me with no problems. I've got a strange problem with screen02 though. I'm finding that it's getting stuck in the InitFrameBuffer function waiting for the pointer to the frame buffer to become !0. I'm sure it's stuck in that loop cause I've made the OK LED flash a sequence...
by badut
Fri Sep 14, 2012 5:39 am
Forum: Bare metal, Assembly language
Topic: need help using timer
Replies: 7
Views: 2637

Re: need help using timer

There's a good example of how to implement a "wait" function in OK04 of the Baking Pi tutorials. See this thread: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=72&t=17057 Alex's wait function is listed in the first post on that thread. I've thrown in my own version of a wait function in the last...
by badut
Fri Sep 14, 2012 5:26 am
Forum: Bare metal, Assembly language
Topic: Baking Pi Required Files
Replies: 16
Views: 3656

Re: Baking Pi Required Files

Does the 16Mb still work on other computers? can write and read data from windows machine for example? That might help diagnose if it's toast. Dun worry, you can get a new one 100 times bigger for a few bucks. Even if it's not toast, it might be worth trying another card just to save you this time. ;)
by badut
Thu Sep 13, 2012 11:37 pm
Forum: Bare metal, Assembly language
Topic: Baking Pi Required Files
Replies: 16
Views: 3656

Re: Baking Pi Required Files

FWIW, I'm pretty sure I formatted my card as FAT (as opposed to FAT32). I put the latest firmware files on there, created a config.txt with kernel_old=1 and never had a problem (just finished Baking Pi Screen01). I don't need to have test_mode=1 I'm using a 1Gb card. But I don't think 16Mb is a prob...
by badut
Thu Sep 13, 2012 4:04 am
Forum: Bare metal, Assembly language
Topic: Baking Pi Required Files
Replies: 16
Views: 3656

Re: Baking Pi Required Files

What's in your config.txt?
Does it do anything if you just put test_mode=1 in your config.txt?

Also try getting the latest firmware from https://github.com/raspberrypi/firmware
And checking that your SD card is formatted as FAT.

(btw, is it really 16Mb? or did you mean 16Gb?)
by badut
Tue Sep 11, 2012 11:27 pm
Forum: Bare metal, Assembly language
Topic: Baking Pi OK04 - Wait function
Replies: 11
Views: 3183

Re: Baking Pi OK04 - Wait function

Sorry to double post, this forum doesn't allow me to edit. Here is my version of the wait function. I think it gets around the possible problems with extremely large wait times. .globl Sleep Sleep: targetTimeLo .req r2 targetTimeHi .req r3 mov targetTimeLo,r0 currTimeLo .req r0 currTimeHi .req r1 pu...
by badut
Tue Sep 11, 2012 9:45 pm
Forum: Bare metal, Assembly language
Topic: Baking Pi OK04 - Wait function
Replies: 11
Views: 3183

Re: Baking Pi OK04 - Wait function

Thanks gents for your thorough explanations. What you've said makes a lot of sense. :D
by badut
Tue Sep 11, 2012 1:17 pm
Forum: Bare metal, Assembly language
Topic: Baking Pi OK04 - Wait function
Replies: 11
Views: 3183

Baking Pi OK04 - Wait function

These tutorials are great! :D Having fun and learning heaps. Just a question that will help my understanding even if I haven't really found a bug. Referring to Alex's Wait function in his solution: .globl Wait Wait: delay .req r2 mov delay,r0 push {lr} bl GetTimeStamp start .req r3 mov start,r0 loop...

Go to advanced search