Page 2 of 3

Re: Got bare bones graphics working

Posted: Sat Jun 16, 2012 10:19 am
by rurwin
nick.mccloud wrote:On the Pi, the kernel HAS to be on the SD card
Not totally true: there has to be a file on the boot partition that we write, but it could just be another level of boot-loader.

Re: Got bare bones graphics working

Posted: Sat Jun 16, 2012 10:33 am
by Narishma
rurwin wrote:Not totally true: there has to be a file on the boot partition that we write, but it could just be another level of boot-loader.
Which is basically what he says in the rest of the sentence you didn't quote.

Re: Got bare bones graphics working

Posted: Sat Jun 16, 2012 2:19 pm
by DexOS
toxibunny wrote:Image

google 'sd slot extender' :)
Thanks, As these look ideal, but i can not find a UK suppler.

Re: Got bare bones graphics working

Posted: Sat Jun 16, 2012 2:30 pm
by DexOS
nick.mccloud wrote:On the Pi, the kernel HAS to be on the SD card - once it's got started it can then look for the rest of the files where ever you tell it to, if it has the code and drivers to do so.
There two choses for this, write code to read/write SD card (not too hard) or as a temple measure, stick a floppy.img to end of kernel (kernel is very small anyway) and read from it with a basic fat driver.

Something like winimage could be used to add files to the image.

Re: Got bare bones graphics working

Posted: Sun Jun 17, 2012 6:37 pm
by DexOS
Just a screenshot of DexOS working with Hdmi, plus my new R PI setup.

Image

Image

Re: Got bare bones graphics working

Posted: Thu Jun 21, 2012 7:05 pm
by pygmy_giant
Cool - can Joe Public get this?

Re: Got bare bones graphics working

Posted: Fri Jun 22, 2012 12:59 pm
by DexOS
pygmy_giant wrote:Cool - can Joe Public get this?
If you mean, can Joe Public download a kernel.img and config.txt to test it sure, if anyone wants to test it, i can upload it to my site (read below).
But as it does nothing much yet, other than set display mode, display image and print to screen and turn led on/off.
I was waiting for it to be ably to do more, like interact with users.
Which i hope to get working in the coming days.

If you mean will the code be available then yes, but not until OS is use able too.

Re: Got bare bones graphics working

Posted: Sun Jun 24, 2012 7:09 pm
by gillespie
DexOS wrote:
pygmy_giant wrote:Cool - can Joe Public get this?
If you mean, can Joe Public download a kernel.img and config.txt to test it sure, if anyone wants to test it, i can upload it to my site (read below).
I'd love to test it if possible, I assume your site is http://www.dex-os.com, but I couldn't find it on there

Thanks

Re: Got bare bones graphics working

Posted: Mon Jun 25, 2012 11:20 am
by pygmy_giant
I class myself more of a nooby end user than developer but would help where I can with testing - I look forward to future release at your convenience.

Re: Got bare bones graphics working

Posted: Mon Jun 25, 2012 2:26 pm
by DexOS
Here is the files if anyone wants to test
http://www.dex-os.com/DexOS_R_PI/DexOS_R_PI.zip

To test, just format a SD card to fat32 and add all the files in the "Put on SD card" folder, that's in the zip file.
Then just startup your raspberry pi with the SD card in.
Simple ;) .

Note: i have only tested with 2 GB SD card.
Any ?, just ask.
And thanks for testing.
Dex.

Re: Got bare bones graphics working

Posted: Mon Jun 25, 2012 6:48 pm
by pygmy_giant
Did as you said and got what you described - it set the display mode, correctly displayed an image on my Sharp 1024 x 768 monitor, printed to the screen (via an HDMI - > DVI adapter) and turned the led on/off. It booted in the blink of an eye and worked first time - my testing is successfully completed.

I did not waste an age 'burning' an 'image' to my SD card - I just copied the files from my windows PC! Legend has it that God handed moses the 10 commandments on the (50x 2gb Kingston elite) SD card that I used. This card was manufactured before the classification system was implimented, so I cannot tell you what 'class' it is - just that it is shaped like an SD card and behaves accordingly.

Good work :P

Re: Got bare bones graphics working

Posted: Mon Jun 25, 2012 8:02 pm
by DexOS
pygmy_giant wrote:Did as you said and got what you described - it set the display mode, correctly displayed an image on my Sharp 1024 x 768 monitor, printed to the screen (via an HDMI - > DVI adapter) and turned the led on/off. It booted in the blink of an eye and worked first time - my testing is successfully completed.

I did not waste an age 'burning' an 'image' to my SD card - I just copied the files from my windows PC! Legend has it that God handed moses the 10 commandments on the (50x 2gb Kingston elite) SD card that I used. This card was manufactured before the classification system was implimented, so I cannot tell you what 'class' it is - just that it is shaped like an SD card and behaves accordingly.

Good work :P
Cool thanks for testing, hope to get a new image out soon with more functions.

Re: Got bare bones graphics working

Posted: Mon Jun 25, 2012 9:29 pm
by tufty
I wouldn't bother with the "encryption" stage next time. If someone can be bothered to fold your binary into something that can be disassembled, anything you can do is broken before you bother to start

It took me 2 minutes, but that's largely because I'm typing on a french keyboard but using an english keymap ;)

Hint :

Code: Select all

$ irb
>> out =File.new "dex.img","w+"
=> #<File:dex.img>
>> i = 0
=> 0
>> File.new("kernel.img").each_byte do |b|
?> if i < 0x803c|| i > 0x803c + 0x1494
>> out.putc b
>> else
?> out.putc b ^ 0xaa
>> end
>> i = i + 1
>> end
=> #<File:kernel.img>
>> out.close
=> nil
>> ^D
$ touch foo.c
$ arm-none-eabi-gcc -c foo.c -o foo
$ arm-none-eabi-objcopy --add-section dex=dex.img foo
$ arm-none-eabi-objdump -D foo | less
Oh, yeah, works here too. Nice one

Simon

Re: Got bare bones graphics working

Posted: Tue Jun 26, 2012 2:09 am
by DexOS
tufty wrote:I wouldn't bother with the "encryption" stage next time. If someone can be bothered to fold your binary into something that can be disassembled, anything you can do is broken before you bother to start

It took me 2 minutes, but that's largely because I'm typing on a french keyboard but using an english keymap ;)

Hint :

Code: Select all

$ irb
>> out =File.new "dex.img","w+"
=> #<File:dex.img>
>> i = 0
=> 0
>> File.new("kernel.img").each_byte do |b|
?> if i < 0x803c|| i > 0x803c + 0x1494
>> out.putc b
>> else
?> out.putc b ^ 0xaa
>> end
>> i = i + 1
>> end
=> #<File:kernel.img>
>> out.close
=> nil
>> ^D
$ touch foo.c
$ arm-none-eabi-gcc -c foo.c -o foo
$ arm-none-eabi-objcopy --add-section dex=dex.img foo
$ arm-none-eabi-objdump -D foo | less
Oh, yeah, works here too. Nice one

Simon
Thanks tufty for testing.
And the simple xor did its job, not to stop, but to see who would want to disassemble it ;) .

Re: Got bare bones graphics working

Posted: Tue Jun 26, 2012 6:51 am
by tufty
Critique time

I'd probably think about changing your function pre/postambles, you're wasting a word on every function.

Rather than this

Code: Select all

mov rX, lr
...
mov lr, rX
mov pc, lr
you'd probably be better off using something like this

Code: Select all

push {rX-rY,lr}
...
pop {rX-rY, pc}
(or do the same using stmdb/ldmia, but push and pop are easier to read)

This not only saves you a word (which you could save in your postamble by simply moving rX to the pc), but also enables you to save any regs that might get smashed 'for free'. For a function that doesn't call any others, and doesn't smash any regs you care about (your wait routine springs to mind, all you have to do is move the loop counter to a 'smashable' register), I wouldn't even bother saving the link register, instead just exit with a simple

Code: Select all

bx lr

Re: Got bare bones graphics working

Posted: Tue Jun 26, 2012 4:29 pm
by walney
DexOS wrote:
toxibunny wrote:Image

google 'sd slot extender' :)
Thanks, As these look ideal, but i can not find a UK suppler.
Found 1 or 2 on ebay (but not cheap at £10+)
http://www.ebay.co.uk/itm/SD-card-exten ... 19d25a528a

Re: Got bare bones graphics working

Posted: Tue Jun 26, 2012 5:02 pm
by DexOS
walney wrote:
DexOS wrote:
toxibunny wrote:Image

google 'sd slot extender' :)
Thanks, As these look ideal, but i can not find a UK suppler.
Found 1 or 2 on ebay (but not cheap at £10+)
http://www.ebay.co.uk/itm/SD-card-exten ... 19d25a528a
Thanks walney, i will get one, i seen them at £35, so the price is OK.

Re: Got bare bones graphics working

Posted: Wed Jun 27, 2012 6:52 pm
by pygmy_giant
Hi Dex - some people like me who are interested in robotics/automation just want to access the GPIO pins and are not bothered about mouse/keyboard/display/usb (although an I2C / SPI driver would be useful). Could this be easily achieved by adapting your demo using a binary compiled from c libraries? I guess what I'm after is just a launch pad to boot straight into some compiled code with I2C / GPIO support.

For projects like a balancing robot or autonomous helicopter/drone less-is more as real-time control is critical.

Do you know how this could be done?

Re: Got bare bones graphics working

Posted: Wed Jun 27, 2012 7:55 pm
by DexOS
pygmy_giant wrote:Hi Dex - some people like me who are interested in robotics/automation just want to access the GPIO pins and are not bothered about mouse/keyboard/display/usb (although an I2C / SPI driver would be useful). Could this be easily achieved by adapting your demo using a binary compiled from c libraries? I guess what I'm after is just a launch pad to boot straight into some compiled code with I2C / GPIO support.

For projects like a balancing robot or autonomous helicopter/drone less-is more as real-time control is critical.

Do you know how this could be done?
You can take a look at the work of dwelch67
https://github.com/dwelch67/raspberrypi

Re: Got bare bones graphics working

Posted: Wed Jun 27, 2012 8:30 pm
by jbeale
I don't have my Pi yet (hopefully soon). Just wanted to say great work so far on the "bare bones" approach, and I'm looking forward to being able to use this code! I'd like to be able to do some realtime stuff without too much extra overhead.

Edit: the github stuff from dwelch67 is very informative; he has some good info in the README files there.

Re: Got bare bones graphics working

Posted: Thu Jun 28, 2012 1:28 pm
by DexOS
jbeale wrote:I don't have my Pi yet (hopefully soon). Just wanted to say great work so far on the "bare bones" approach, and I'm looking forward to being able to use this code! I'd like to be able to do some realtime stuff without too much extra overhead.

Edit: the github stuff from dwelch67 is very informative; he has some good info in the README files there.
Thanks jbeale, i hope you find it useful.

Re: Got bare bones graphics working

Posted: Fri Jun 29, 2012 4:27 pm
by gillespie
So as far as I can tell, the pi seems to ignore whatever values you pass it in the FB struct (e.g. for width/height) and just use the values from config.txt. Is this what's supposed to happen, or am I doing something wrong? I've not tried the linux framebuffer driver, but I assume that can switch modes on the fly, so it must be possible.

Re: Got bare bones graphics working

Posted: Fri Jun 29, 2012 7:17 pm
by DexOS
gillespie wrote:So as far as I can tell, the pi seems to ignore whatever values you pass it in the FB struct (e.g. for width/height) and just use the values from config.txt. Is this what's supposed to happen, or am I doing something wrong? I've not tried the linux framebuffer driver, but I assume that can switch modes on the fly, so it must be possible.
It should not ignore the values pass to FB struct and yes you can switch modes on the fly, has the above demo does.

Re: Got bare bones graphics working

Posted: Sun Jul 01, 2012 9:54 am
by gillespie
DexOS wrote:
gillespie wrote:So as far as I can tell, the pi seems to ignore whatever values you pass it in the FB struct (e.g. for width/height) and just use the values from config.txt. Is this what's supposed to happen, or am I doing something wrong? I've not tried the linux framebuffer driver, but I assume that can switch modes on the fly, so it must be possible.
It should not ignore the values pass to FB struct and yes you can switch modes on the fly, has the above demo does.
Yeah sorry, it was just me being an idiot and using the wrong bit of memory... all is well now, thanks

Re: Got bare bones graphics working

Posted: Wed Jul 04, 2012 8:53 pm
by DexOS
A cool fractal demo by krom.
Running bare metal on Raspberry Pi.
Using FasmArm of cause.
Image