Page 1 of 2
Beaglebone Black OS from scratch 100% ASM
Posted: Wed Oct 12, 2016 7:53 am
by Factorisable
Hi,
i bought a Beaglebone Black, i want to create its OS from scratch but i do not know where to start, i need help, may be a book ? For info, it is an embedded board with an ARM CORTEX A-8.
Thank you in advance.
Re: Beaglebone Black OS from scratch 100% ASM
Posted: Wed Oct 12, 2016 9:37 am
by iansjack
You might look at this for starters:
https://github.com/allexoll/BBB-BareMetal
There's also a thread here that might give you some ideas:
https://groups.google.com/forum/#!topic ... m_GPuYtCCY
Re: Beaglebone Black OS from scratch 100% ASM
Posted: Sat Oct 15, 2016 7:13 am
by Factorisable
Thank you for these links. Be able to write ARM assembly code, to read and understand datasheet, know electronic, do i need something else to program this OS?
Re: Beaglebone Black OS from scratch 100% ASM
Posted: Sat Oct 15, 2016 11:37 am
by iansjack
You probably want to be able to program in C otherwise, but that should be enough along with the other skills you mention.
Re: Beaglebone Black OS from scratch 100% ASM
Posted: Sun Oct 16, 2016 8:38 am
by Schol-R-LEA
iansjack wrote:You probably want to be able to program in C otherwise, but that should be enough along with the other skills you mention.
Note that this applies even for a pure assembly OS. Why? Because most of the other operating systems are written in C, as is most of the example code for low-level operations. You might not choose to write in C, but for many of the things you will want to study, being able to read C is is essential.
Re: Beaglebone Black OS from scratch 100% ASM
Posted: Sun Oct 16, 2016 9:28 am
by Schol-R-LEA
I realize that you already have done a fair amount of work on an OS project before, but it sounds like you may have some gaps in your background knowledge; if you haven't already, I would strongly recommend reading the introductory material in the wiki:
Getting Started
How To Ask Questions
FAQ
Required Knowledge
Beginner Mistakes
What order should I make things in
Code Management
How kernel, compiler, and C library work together
Using Programming
Languages other than C
Bootloader and
Rolling Your Own Bootloader, though most of this is aimed at x86
FAT and
SFS
While this is a lot of reading, it simply reflects the due diligence that any OS-devver needs to go through in order to get anywhere. OS development, even as a simple project, is not amenable to the Stack Overflow cut-and-paste model of software development; you really need to understand a fair amount of the concepts and principles before writing any code, and the examples given in tutorials and forum posts generally are exactly that. Copying an existing code snippet without at least a basic idea of what it is doing simply won't do. While learning itself is an iterative process - you learn one thing, try it out, see what worked and what didn't, read some more, etc. - in this case a basic foundation is needed at the start. Without a solid understanding of at least some of the core ideas before starting, you simply can't get very far in OS dev.
Re: Beaglebone Black OS from scratch 100% ASM
Posted: Wed Oct 19, 2016 1:24 am
by Factorisable
Thank you very much all, i will see these links Schol-R-LEA.
Re: Beaglebone Black OS from scratch 100% ASM
Posted: Wed Oct 19, 2016 4:48 am
by gerryg400
Hi, I've done a little bare metal development on BBB and would recommend TI Starterware as a starting point. I began there and replaced it piece by piece with my own code as I learned the platform. Starterware will help you understand the BBB boot process and give you some hints about how to debug your code.
Re: Beaglebone Black OS from scratch 100% ASM
Posted: Tue Oct 25, 2016 1:54 am
by Factorisable
Thank you gerryg400 for this advice. Does anyone know a compiler to produce binary files of ARM assembly ?
Re: Beaglebone Black OS from scratch 100% ASM
Posted: Tue Oct 25, 2016 2:32 am
by iansjack
gcc.
Re: Beaglebone Black OS from scratch 100% ASM
Posted: Sun Oct 30, 2016 7:26 am
by Factorisable
gcc, is it through the use of c language ?
Re: Beaglebone Black OS from scratch 100% ASM
Posted: Sun Oct 30, 2016 9:15 am
by iansjack
Although primarily for C, gcc can handle C++, assembler, and many other languages.
Personally, I would strongly recommend C for OS development, with just a few assembler files. In-line assembler is best avoided if possible.
Re: Beaglebone Black OS from scratch 100% ASM
Posted: Sun Oct 30, 2016 2:40 pm
by canard
The documents you will need for this are:
* Beaglebone black schematic
* AM335x Technical Reference Manual
* Cortex-A8 Reference Manual
* ARMv7 Reference Manual
I very much recommend using uboot as your bootloader. Otherwise you will have to initialize DRAM and all the peripherals yourself. You can configure uboot to load your kernel over the serial port using XMODEM protocol. Uboot is already present on the EMMC or SD card, so you just have to change its configuration to load your kernel instead of linux.
You will want to use the serial headers on the board for debug output and loading your kernel. You will want a UART to USB
adapter.
There is also a qemu board emulator available for an older revision of the beaglebone. It can be useful, but the peripheral addresses will be different from the am335x used in the beaglebone bloack.
I have a some baremetal code at
https://github.com/benls/baremetal.
Re: Beaglebone Black OS from scratch 100% ASM
Posted: Mon Oct 31, 2016 9:31 am
by Ycep
It seems weird that you are starting with writing an OS for some less popular archiceture with less documentation than writing an OS for the most popular archiceture with the most detailed documentation and support.
Re: Beaglebone Black OS from scratch 100% ASM
Posted: Mon Oct 31, 2016 12:52 pm
by Schol-R-LEA
Lukand wrote:It seems weird that you are starting with writing an OS for some less popular archiceture with less documentation than writing an OS for the most popular archiceture with the most detailed documentation and support.
Well, aside from anything else, keep in mind that the ARM in general (though certainly not the B3)
is the most popular ISA right now - just not in desktops. Something like 95% of all smartphones and tablets, and a wide variety of embedded hardware as well, and is making significant inroads into the server markets. The Intel ISA seems more important than it really is because of its use in the PC and current-gen Mac platforms, much like Unix seemed more important than it was to University students in the 1980s because it was run on most of the academic mainframes and workstations (but hardly anywhere else).
As for documentation, the ARM documentation is less voluminous, and has a lot less independent documentation, but conversely they don't have the voluminous misinformation and outdated information that is floating around for PCs. Volume is not a very good indicator of documentation quality; the MIPS specification is much smaller than either one, yet it is so simple that designing a simulated circuit design for it is a common undergrad project. When it comes to specifications, small can be beautiful, so long as it is also clear and complete.