How can I start writing my own mobile OS for ARM processors?

I am interested in building my own mobile OS. I read that existing mobile OSs run on ARM processors and use their assembly language, while desktop OSs like Linux and Windows write in asm. C is a language common to both. This leads me to some questions:

  • Do I have to learn the ARM assembly language if I want to build my own mobile OS targeting the ARM Cortex processor?

If so, then as soon as I start doing this:

  • Where / how to check it? Can it run in a virtual machine?
  • There are boards like the Beagleboard, but I don't understand why I need to buy them if I can use a virtual machine - am I missing something here?
  • Can one OS work with both x86 and ARM?

I'm sure I want to create a mobile OS that can run on ARM processors like most of the existing mobile OS.

  • What should be my first steps? Would it help to watch open source projects like Android or other OS?
  • Where can I find the ARM and IDE assembly language resources?
+3


source to share


1 answer


1) build is required for all platforms, you probably need startup code to cover the assumptions about the programming language, for example, the C compiler assumes that you set up the stack (pointer) and zeroed out the memory .bss, .data is in the right place, etc. .d. Depends on the processor, but usually you might need some code to handle interrupts and possibly task switching, etc.

2) yes there are many virtual machines, qemu, skyeye, etc. I have one result from an amber project on opencores http://github.com/dwelch67/amber_samples

3) it is very rare that an instruction set simulator or virtual machine, etc. matches the processor exactly. Just because it works on vm / sim doesn't mean it works. It is no different from running code in and outside the debugger. You should try different simulators as well as equipment to test the quality of the simulator. One processor to another, or one x86 to another, can be different enough to cause your software to crash, so even hardware work isn't enough to sort out all of your potential mistakes.

4) linux works on many platforms huh? Netbsd works even harder, right? Depending on how you design your program, it might be very portable or not portable, or somewhere in between. It depends on you.

5) You need some basic operating system. maybe get a MicroC / OS-II book or some other similar material. Learn the basics of task switching, etc.



6) IDE and editors, etc. - a very personal matter, one of the loved ones hates others. For ARM development, you need to get ARM ARM (ARM Architectural Reference Manual). What was previously the only document was divided due to the fact that they had many different nuclei and families. What is the oldest looking, ARMv5 or ARMv6 ARM is what used to be the only one. Get this, and you can at least write more portable code across the core family. You will want to get TRM (Technical Reference Manuals). Get one for ARM7TDMI (ARMv4T), just like getting 486 manual from Intel, almost all (32 bit hand instructions) as it is compatible with this kernel. Perhaps you would like to get TRM for other families. Understand that although an older version, such as rev 1.0 (r1p0), may be marked obsolete,if there is a manual for it, ARM sold it to someone and it exists somewhere in some chips and you might need to know the differences between the two (if you aim that closely). Peripherals like PL310 L2 cache are often found in some cores, you probably want to know what is in there if you have an interest in enabling and using the cache. Hmmm, arm7 (ARMv4, not to be confused with ARMv7) doesn't have mmu, I think ARM9 does, so depending on how you want to manage apps and their memory, you can use ARM9 or something new as a baseline ...such as PL310 L2 cache are often found in some cores, you probably want to know what is there if you have an interest in enabling and using cache. Hmmm, arm7 (ARMv4, not to be confused with ARMv7) doesn't have mmu, I think ARM9 does, so depending on how you want to manage apps and their memory, you can use ARM9 or something new as a baseline ...such as PL310 L2 cache are often found in some cores, you probably want to know what is there if you have an interest in enabling and using cache. Hmmm, arm7 (ARMv4, not to be confused with ARMv7) doesn't have mmu, I think ARM9 does, so depending on how you want to manage apps and their memory, you can use ARM9 or something new as a baseline ...

get code chain based on codeourcery lite gnu. codeourcery is now part of mentor graphics. It's not hard to create your own cross-compiler for your hand or get some other (emdebian, etc.). ARM makes a good compiler, but it's expensive and most of the support will come from them for the price, of course an online search engine for help, but a lot of free help is based on gcc. llvm compiler tools are getting better every day, they are used on iPhone from what I understand. I am using the clang compiler which is part of llvm. You don't need to create a cross compiler necessarily out of the box, they are a language to staging cross compiler for the target assembly. the build and linking targets the host, but you can use the gnu binutils assembler and linker for this last step.

Much like the IDE / editor, your programming style and preferences can lead you to favor one compilation environment over another.

Maybe you find my examples of hands on github useful or not, they are low level, you can give examples of types. Mostly on the thumb, but with some hand where possible.

+18


source







All Articles