Page 1 of 2
ARM OSdev
Posted: Wed Jan 01, 2014 3:29 pm
by v00d00
Hello all. This is also my first post so I indtoruce myself. I'm v00d00.
Now to the point.
So my semper-fi china tablet (with ARMv7 processor) fell down and the screen crashed and now the ****'s fucking slow. I used it mainly for reading after that. But I'm thinking of wiping the whole OS and start using it as my OSdev test tool.
I started reading a bit about x86 osdev but I've never had a personal x86 computer to test my stuff on directly, I used an x86 emulator in my tablet. I was going quite well, checking the source of that MikeOS thing....
Well my questions are the following:
1. How can I wipe the OS from my tablet?
2. How can I make it boot from a PC or load the code from a PC?
3. What software do I need to assemble for ARM? (if it's Windows software, can it be run from a flash drive?)
4. Tutorials? Most tutorials are for the x86 architecture, but the BIOS in x86 I guess has nothing to do with the ARM "bootloader"
I've seen a couple examples of ARM OS's, but nothing much, really.
I'm also thinking how I am going to be able to handle the device drivers, I srsly have NO IDEA of how they're defined in the tablet...
Thank you for helping me, I know these are n00b questions!
Oh I'm also going to buy a GBA, do you think the same OS could run in both the gba and the tablet? both have ARM processors....
Re: ARM OSdev
Posted: Wed Jan 01, 2014 4:09 pm
by iansjack
If you haven't done any OS programming to date then I honestly wouldn't recommend starting with ARM programming. It is an order of magnitude more difficult than x86 OS development because 1. there are relatively few people doing it (and so less help available), and 2. it is much more difficult to find information about the chips used in ARM devices - and they are far less standard than PCs.
No doubt someone will now prove me wrong by providing simple yet comprehensive answers to your questions, but that's my opinion.
Re: ARM OSdev
Posted: Wed Jan 01, 2014 6:27 pm
by OSwhatever
ARM OS dev is not more difficult than x86. It is the most usual processor in the world and there is plenty of documentation about it.
If you have a HW board you need documentation about its hardware but when you have that it should be pretty straight forward. For OS developing a JTAG debugger will help enormously because otherwise you might be blind what's really happening. You can perhaps do with prints but it cannot catch everything.
Re: ARM OSdev
Posted: Wed Jan 01, 2014 6:29 pm
by Love4Boobies
In theory, you could use your tablet for OS development. However, it is most likely that the vendor didn't release any documentation for your hardware. You could then check to see whether anyone's bothered to reverse engineer your device and do it yourself if not.
The more attractive solution is to get one of the more open platforms out there. For instance, OMAP-based ones (e.g., BeagleBoard, PandaBoard) and the Raspberry Pi are very popular choices.
Re: ARM OSdev
Posted: Wed Jan 01, 2014 6:49 pm
by v00d00
Love4Boobies wrote:In theory, you could use your tablet for OS development. However, it is most likely that the vendor didn't release any documentation for your hardware. You could then check to see whether anyone's bothered to reverse engineer your device and do it yourself if not.
The more attractive solution is to get one of the more open platforms out there. For instance, OMAP-based ones (e.g., BeagleBoard, PandaBoard) and the Raspberry Pi are very popular choices.
Yeah... them hardware specifics I think are the main problem. I was also thinking of developing for a raspberry pi instead....
Re: ARM OSdev
Posted: Wed Jan 01, 2014 7:09 pm
by Love4Boobies
If I am not mistaken, QEMU fully supports the Raspberry Pi, so that may be of help, too.
Re: ARM OSdev
Posted: Thu Jan 02, 2014 1:44 am
by iansjack
ARM processors are indeed very well documented - if only that was the only difficulty in programming an OS. The Raspberry Pi is cited as an example, but the amount of documentation available for the chips used in the Pi is minimal compared to PCs. I can find a host of tutorials and other resources about programming an OS for a PC; I can find just one for the Pi, and that relies on a pre-compiled USB keyboard driver. I have found nothing regarding mass storage access on the Pi. Perhaps one of the advocates could link to such resources.
I've no doubt that these things will come in time but, to my mind, a beginner would do better to be pragmatic and start with an x86 system. If anyone is successfully developing a home-brew OS on a Pi I would love to see their work.
Re: ARM OSdev
Posted: Thu Jan 02, 2014 6:56 am
by nerdguy
If you are interested in ARM, I recommend to checkout FASMARM which is an ARM assembler. However It runs only on x86 machines. As for the manual I think it's called ARMARM (ARM Architecture Reference Manual). Also an RPi would be a better choice for development, it costs around $20-30. There are many examples on the FASM Board under non-x86-architectures.
I guess this is already on the wiki but here are some RPi examples (not written by me) which could prove useful
https://github.com/dwelch67/raspberrypi
Re: ARM OSdev
Posted: Thu Jan 02, 2014 7:02 am
by iansjack
Blink-a-led program's for the Pi are easy enough to find. Reading from a keyboard; writing to the screen a little more tricky. Writing and reading a mass storage device - that's what I'd like to see.
Re: ARM OSdev
Posted: Thu Jan 02, 2014 7:09 am
by nerdguy
iansjack wrote:Blink-a-led program's for the Pi are easy enough to find. Reading from a keyboard; writing to the screen a little more tricky. Writing and reading a mass storage device - that's what I'd like to see.
I think there is a guy on FASM forum called Dex, He has made his own macro-based programming language called DexBASIC.(I think it supports the PRINT command)
It has
EDIT : Found it
http://www.dex-os.com/DexBasic/DexBasic.htm
EDIT2 : This is Alex Chadwick USB Stack converted to FASMARM by the same person. Could be useful
http://board.flatassembler.net/topic.php?t=16132
Re: ARM OSdev
Posted: Thu Jan 02, 2014 7:17 am
by xenos
Love4Boobies wrote:If I am not mistaken, QEMU fully supports the Raspberry Pi, so that may be of help, too.
Oh, nice, I didn't know that - I need to check this out. Apparently stuff like LEDs and I/O ports are not supported, but at least one can do quite a lot with it.
Re: ARM OSdev
Posted: Thu Jan 02, 2014 7:33 am
by iansjack
A qemu setup is a great way to develop and test user programs for the Pi, being rather faster than the real thing, but not so good when it comes to OS development.
Are any of those here who are recommending the Pi for ARM OS development actually working on this? Would they care to publish code showing how to work with keyboard, video output, and mass storage? It's easy to find this sort of thing for PC work (hence my original comment).
Re: ARM OSdev
Posted: Thu Jan 02, 2014 8:13 am
by MadZarx
You can also take a look at linux source code for ARM architecture. You can find the sources at
www.kernel.org
But as a starting point I suggest you to start your OS development for Raspberry Pi because there are some documentations about it. It may be harder to start it on your tablet as there may be no documentation about your tablet hardware.
Good luck
Re: ARM OSdev
Posted: Thu Jan 02, 2014 8:30 am
by lexected
I was also thinking of starting with RPi some time ago and I found one
tutorial which goes through basics, but there was no reference on real broadcom documentation for RPi graphics, or as iansjack said,
SD card. Then I found
this article and I lost my interest.
Re: ARM OSdev
Posted: Thu Jan 02, 2014 9:34 am
by jnc100
iansjack wrote:Would they care to publish code showing how to work with keyboard, video output, and mass storage?
It's relatively easy to set up and use the framebuffer for the Pi, however accelerated video output (3d/video decoding etc) is substantially more difficult as the GPU does not have open documentation. An example framebufffer implementation (from my rpi-boot project) is
here.
The SD card reader is essentially a standards-compliant
SDCHI implementation, with a few quirks as specified
here. There is again a sample block driver (reasonably self-contained) in rpi-boot
here.
Keyboard, network and USB mass storage are more problematic. These are all based off the USB bus on the Pi, and the host controller has little in the way of open documentation (all work has been via reverse engineering or looking at linux source). As far as I am aware, there are working drivers for linux, FreeRTOS and uboot. Once the host controller driver is implemented, the rest of the USB stack should be exactly the same as in x86 though (e.g. hub, mass storage, HID etc). I kept meaning to implement my own driver for this (the freely available keyboard one does not support enough of the USB standard to work for mass storage or networking) but never got around to it. I also freely admit to probably not being the best person to do this as I haven't implemented a USB stack for x86 (UHCI/OHCI/EHCI etc) yet.
Regards,
John.