User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

WIP: A new learning Toy OS, for the RPi 3B.

Sat Nov 17, 2018 6:09 pm

I am working on writing a simple micro-kernel operating system for the Raspberry Pi 3B (possibly could be ported to others later). The purpose of the OS is to demonstrate some concepts of OS theory and implementation, so that everyone may learn. I am hoping to learn a lot in the process, as that is what makes it fun.

This OS is going to be written mostly in C, and compiled with gcc. The assembly components needed to get some things up and running are going to be written in ObjASM syntax using the AsAsm assembler (on RISC OS).

This project has barely started, I have not yet gotten any of the little bit of code uploaded yet. Though for those that would like to follow along the url to the site where I am putting everything is:
https://asmfun.riscos.fr/osdev/index.html

USING BSD 2 CLAUSE LICENSE
After a good amount of debate about the license, primarily between the MIT and 2 clause BSD licenses I have settled on using a 2 clause BSD license.

After thinking about it for a while I realized that the 2 clause BSD license is equal in its permisiveness to the MIT license, and the 2 clause BSD license does a better job with the disclaimer of liability (important when other people can modify and use your code).

I want this project to be as widely usable as possible, hence the choice of a very permisive license.

WE HAVE A NAME
YANGTOS stands for Yet ANother Goliath Tiny Operating System.

Thank you Burngate.

THE OS NEEDS A NAME:
I am not coming up with an appropriate name for this operating system. Any suggestions for a name are very much appreciated. If I want to use a suggested name, and the suggestor allows me to use it without restriction, I will give credit to the source of the name so long as I have there real name.
Last edited by DavidS on Sun Nov 18, 2018 2:11 pm, edited 4 times in total.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

User avatar
Burngate
Posts: 6100
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: WIP: A new learning Toy OS, for the RPi 3B.

Sat Nov 17, 2018 6:32 pm

Looks interesting - keep us posted!

As to a name for it: if I were called David, I'd want to call something I was building either Solomon or Goliath, and since this is meant to be as simple and small as possible - the very antithesis of those two - either name might do.

User avatar
DarkPlatinum
Posts: 853
Joined: Thu Nov 02, 2017 2:30 pm
Location: Unknown
Contact: Website YouTube

Re: WIP: A new learning Toy OS, for the RPi 3B.

Sat Nov 17, 2018 7:05 pm

Nice! LearnALot OS
1 * Raspberry Pi Zero W, 1 * Raspberry Pi 2, 1 * Raspberry Pi 3 1 * Raspberry Pi 3B + :mrgreen:

Check Out My Raspberry Site (Run on a Raspberry Pi 3B :) ): https://html.dynu.net

User avatar
davidcoton
Posts: 4259
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: WIP: A new learning Toy OS, for the RPi 3B.

Sat Nov 17, 2018 9:54 pm

DavidOS.
Signature retired

drgeoff
Posts: 9926
Joined: Wed Jan 25, 2012 6:39 pm

Re: WIP: A new learning Toy OS, for the RPi 3B.

Sat Nov 17, 2018 10:35 pm

DavOS rolls off the tongue better. :)

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: WIP: A new learning Toy OS, for the RPi 3B.

Sat Nov 17, 2018 10:59 pm

Some good suggestoins so far.

I am a little further behind than planned, as I had forgotten today was a friends memorial service.

So I may not have the extra pages on the site until tommorrow.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

W. H. Heydt
Posts: 11106
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: WIP: A new learning Toy OS, for the RPi 3B.

Sat Nov 17, 2018 11:59 pm

drgeoff wrote:
Sat Nov 17, 2018 10:35 pm
DavOS rolls off the tongue better. :)
Only if the programs that run under it are called Daleks.

drgeoff
Posts: 9926
Joined: Wed Jan 25, 2012 6:39 pm

Re: WIP: A new learning Toy OS, for the RPi 3B.

Sun Nov 18, 2018 8:26 am

W. H. Heydt wrote:
Sat Nov 17, 2018 11:59 pm
drgeoff wrote:
Sat Nov 17, 2018 10:35 pm
DavOS rolls off the tongue better. :)
Only if the programs that run under it are called Daleks.
No, the creator of the Daleks was Davros.

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: WIP: A new learning Toy OS, for the RPi 3B.

Sun Nov 18, 2018 12:37 pm

drgeoff wrote:
Sun Nov 18, 2018 8:26 am
W. H. Heydt wrote:
Sat Nov 17, 2018 11:59 pm
drgeoff wrote:
Sat Nov 17, 2018 10:35 pm
DavOS rolls off the tongue better. :)
Only if the programs that run under it are called Daleks.
No, the creator of the Daleks was Davros.
Which spoken aloud sounds a lot like DavOS. Phonetically they are very similar (R is not well heard as phonemes go).
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: WIP: A new learning Toy OS, for the RPi 3B.

Sun Nov 18, 2018 12:43 pm

I think I will go with:

YANGTOS for Yet ANother Goliath Tiny Operating System.

As long as noone sees a reason that I should avoid that name.

Thank you to Burngate for the suggestion. I will being giving credit in the notes about YANGTOS.
Last edited by DavidS on Sun Nov 18, 2018 12:55 pm, edited 1 time in total.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

User avatar
hansotten
Posts: 324
Joined: Fri Jul 13, 2012 6:01 am
Contact: Website

Re: WIP: A new learning Toy OS, for the RPi 3B.

Sun Nov 18, 2018 12:52 pm

drgeoff wrote:
Sat Nov 17, 2018 10:35 pm
DavOS rolls off the tongue better. :)
And sounds a lot like a well known skiing resort in Switzerland!
http://duinorasp.hansotten.com for Raspberry Pi and Arduino and ESP8266
http://retro.hansotten.nl for retrocomputing with the 6502 cpu

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: WIP: A new learning Toy OS, for the RPi 3B.

Sun Nov 18, 2018 1:01 pm

Now I need to figure out what license, before I begin posting code. So how should I license the source?

I was thinking either a 2 clause BSD license or a MIT license. I want a minimal of restrictions to the use of the code (it is intended for learning), while keeping some small note of where it comes from (to preserve its legacy over time, if it lasts anywhere). I also want to be able to change the license to something even less restrictive in the future if I feel it appropriate at that time (like an unlicense [which gets around the fact that some areas do not allow public domain]).

So I am asking for some kind of input on the issue of license.

I want the first site update of today to reflect both the YANGTOS name and the license moving forward.

@Hansotten:
I do not like the idea of that direct of a reference to the author. It feels egomania in its nature.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: WIP: A new learning Toy OS, for the RPi 3B.

Sun Nov 18, 2018 1:25 pm

YANGTOS will be licensed under the 2-clause BSD License.
See:
https://opensource.org/licenses/BSD-2-Clause


I realised that the 2-clause BSD license is effectively identicle to the MIT license in its permissiveness, and further the 2-clause BSD license has a more complete, less ambiguous, disclaimer of liability.

Off to get the first update of the day up.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: WIP: A new learning Toy OS, for the RPi 3B.

Sun Nov 18, 2018 5:55 pm

Well it will be soon that the actual OS code starts apearing on my site.
I am writing a utility to convert C source into syntax highlighted HTML on RISC OS. This will aid in getting the code to the site, as it will take a lot of the work out of displaying the source in a page describing its function. It is interesting how one project so often involves the creation of other tools that are not part of the project it self.

I added a super simple console output module that outputs text to the framebuffer in a readable form (and added enough to the kernel to get the module running). This should make going forward a little easier. Though so far I have only created the uper case alphabet, numbers, and some operator symbols for the bitmapped font used by console output, so it has some limits.


Also debating throwing some code into the kernel for debuging, to display some small bitmapped images, so that a kernel crash before any module gets loaded can be cought, or if there is a crash that pushes things all the way down it still will have a way to report.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

Heater
Posts: 13923
Joined: Tue Jul 17, 2012 3:02 pm

Re: WIP: A new learning Toy OS, for the RPi 3B.

Sun Nov 18, 2018 8:59 pm

Don't do that.

Just push your code to github.com. Then we can see what you have with syntax highlighting and all.
Memory in C++ is a leaky abstraction .

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: WIP: A new learning Toy OS, for the RPi 3B.

Sun Nov 18, 2018 10:05 pm

Heater wrote:
Sun Nov 18, 2018 8:59 pm
Don't do that.

Just push your code to github.com. Then we can see what you have with syntax highlighting and all.
Now why would I want to push my code onto a MS controlled server?

For that matter why would I want to put code that uses RISC OS as a build environment to a type of repo that there is difficulty accessing from in RISC OS?

I will go with the most future proof method for me, I will be uploading the code to my site, in zip's. I will include a form of version controll so that the version can be rolled back to an earlier version if desired, though it will be after downloading a full tree version (and I will offer just current version archives as well, and keep around any major release as a just that version archive).

Though I have seen to many different version control systems come and go. Doing it this way is more likely to ensure the longevity, in proportion to how many people become interested in the project. Each person that downloads it is another backup of the source. If my site goes off-line then another will be able to post the code to there site.

And I do not like the source highlighting that uses a white background and a proportional fornt. Fixed width fonts have there place in source code, fixed width fonts allow for better alignment. Black backgrounds makes for better contrasting color choices for syntax highlighting.

I had already tried a few things that already do the translation, though one used style sheets, another abused charactor codes, etc. Nothing wrong with style sheets, it just clashes with the way my site is done.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

User avatar
DarkPlatinum
Posts: 853
Joined: Thu Nov 02, 2017 2:30 pm
Location: Unknown
Contact: Website YouTube

Re: WIP: A new learning Toy OS, for the RPi 3B.

Sun Nov 18, 2018 10:11 pm

DavidS wrote:
Sun Nov 18, 2018 10:05 pm
Heater wrote:
Sun Nov 18, 2018 8:59 pm
Don't do that.

Just push your code to github.com. Then we can see what you have with syntax highlighting and all.
Now why would I want to push my code onto a MS controlled server?

For that matter why would I want to put code that uses RISC OS as a build environment to a type of repo that there is difficulty accessing from in RISC OS?

I will go with the most future proof method for me, I will be uploading the code to my site, in zip's. I will include a form of version controll so that the version can be rolled back to an earlier version if desired, though it will be after downloading a full tree version (and I will offer just current version archives as well, and keep around any major release as a just that version archive).

Though I have seen to many different version control systems come and go. Doing it this way is more likely to ensure the longevity, in proportion to how many people become interested in the project. Each person that downloads it is another backup of the source. If my site goes off-line then another will be able to post the code to there site.

And I do not like the source highlighting that uses a white background and a proportional fornt. Fixed width fonts have there place in source code, fixed width fonts allow for better alignment. Black backgrounds makes for better contrasting color choices for syntax highlighting.

I had already tried a few things that already do the translation, though one used style sheets, another abused charactor codes, etc. Nothing wrong with style sheets, it just clashes with the way my site is done.
Do what you feel best is for your OS, don't let others stop what you really want to do.
1 * Raspberry Pi Zero W, 1 * Raspberry Pi 2, 1 * Raspberry Pi 3 1 * Raspberry Pi 3B + :mrgreen:

Check Out My Raspberry Site (Run on a Raspberry Pi 3B :) ): https://html.dynu.net

Heater
Posts: 13923
Joined: Tue Jul 17, 2012 3:02 pm

Re: WIP: A new learning Toy OS, for the RPi 3B.

Sun Nov 18, 2018 10:35 pm

DavidS,
Now why would I want to push my code onto a MS controlled server?
OK. Good point.

Although git is nothing to do with MS. There are other places, bitbucket, gitlab, do it yourself server, etc.

You are right, if your code needs RISC OS to be useful then I should not complain, I will never see it.
Memory in C++ is a leaky abstraction .

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: WIP: A new learning Toy OS, for the RPi 3B.

Mon Nov 19, 2018 1:38 am

Well I am placing the HTML converter on the back burner. It is not yet far enough along to be really usefull, though I can just use HTML < pre > and < code > tags around the code for now, and not worry about syntax highlighting, until I come back to this sub project.

This has delayed getting anything else done on the site yet another day. Well this combined with unexpected interruptions.
Heater wrote:
Sun Nov 18, 2018 10:35 pm
DavidS,
Now why would I want to push my code onto a MS controlled server?
OK. Good point.

Although git is nothing to do with MS. There are other places, bitbucket, gitlab, do it yourself server, etc.

You are right, if your code needs RISC OS to be useful then I should not complain, I will never see it.
You may see it yet. Just because it is being written to initially build on RISC OS, it can still be built on other platforms. The only difficulty I see possible is the choice of assembler, though it should be easy enough to make whatever small changes (or just port asasm, it is open source, and should compile on Linux without to much problem).

The C toolchain is gcc 4.7.4 (will be updated over time), that is gnu versions of:
  • addr2line
  • ar
  • as
  • c++filt
  • cpp
  • elfedit
  • elf2aif
  • gcc
  • gcc-*
  • gconv
  • gprof
  • ld
  • make
  • mkresfs
  • objcopy
  • objdump
  • readelf
So if someone wanted to build it under ARM Linux I do not see anything stopping them, exept for the lack of asasm (or ObjAsm), and it should be possible to port asasm to Linux.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: WIP: A new learning Toy OS, for the RPi 3B.

Mon Nov 19, 2018 2:20 am

For an example of how I intend to do the source for now (until I get the utility completed) see my blog page, as I posted about this issue:
https://asmfun.riscos.fr/blog.html
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: WIP: A new learning Toy OS, for the RPi 3B.

Mon Nov 19, 2018 4:24 pm

Well I have enough of the site done that it is probably best to look there for updates.

I have added a Documents page. While it does not yet contain any documents, it gives me a container to add documents to. Sometimes I may even just write a text document, and later come back to it and redo it in HTML.

Also I am planning on adding the page for downloads later today, as well as a news page (to replace the rambling status box on the main page).

I need to put togather a good list of resources so that I may be able to put up a links page with good third party information on OS Theory, SMP, ARM, MMU's, VideoCore IV, Raspberrry Pi HW, USB, Bluetooth, Ethernet, TCP/IP, and the BCM2835/6/7 SoC's.

I also just realized that I do not have listed a place for information on BlueTooth or Ethernet. I will have to add those to the list of documents todo.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: WIP: A new learning Toy OS, for the RPi 3B.

Tue Nov 20, 2018 12:41 pm

Writing an OS is fairly simple, so long as the basic concepts are understood.

Writing a filesystem is a little harder, though still fairly simple.

Writing Hardware Support code is even harder, and sometimes a bit difficult.

Writing a complex application is even harder.

Writing documentation to describe how everything works is Extremely difficult. And this is where I am. I am attempting to write the documentation for what is already done, in complete detail. That is the most difficult part of a project like this, to the point that there are many places that I rely on the reader being familiar with C and use the code to describe the algorithm, as it is difficult to do a good job of describing how an algorithm works.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: WIP: A new learning Toy OS, for the RPi 3B.

Wed Nov 21, 2018 3:49 pm

I am switching primary implementation programming languages.

Now I am going with FreeBASIC, as thinking got me to primarily work from Raspbian which allows the use of FreeBASIC. And FreeBASIC is the only current compiler I am aware of that is appropriate for developing an OS kernel.

I am taking this opportunity to not only show hows on OS design, though also to show that BASIC is NOT dead, though still very useful.

I am also looking for other FreeBASIC compatible compilers that may be out there, as there may be better options (if can find others that can target ARM). Unfortunately at this time FreeBASIC uses gcc as a back end for ARM targets, while it will directly produce x86 code. Also many of the FreeBASIC standard library functions are written in C instead of BASIC.
Last edited by DavidS on Thu Nov 22, 2018 12:10 am, edited 1 time in total.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: WIP: A new learning Toy OS, for the RPi 3B.

Wed Nov 21, 2018 11:27 pm

Desregard the previous post. I got fed up with Linux a bit to fast when I got to attempting to recompile YANGTOS. Still with the same C source (and minimum assembly), I attempted to do a clean build (to see how it does), the end results of multiple attempts were not great (despite using the same tool chain as I did on RISC OS).

It is quite telling, and I am not going to attempt to build the project inside of RPCEmu.

Though I am very likely to see what I can do in BBC Basic V for higher levels of the OS. I will be looking for a BBC BASIC V compiler, for RISC OS, with available source that does not require a closed source library module.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

Heater
Posts: 13923
Joined: Tue Jul 17, 2012 3:02 pm

Re: WIP: A new learning Toy OS, for the RPi 3B.

Thu Nov 22, 2018 3:07 am

Could you elaborate on why your build was failing.

You have no code to look at on the YANGTOS site but judging by the example source quoted there it looks like straight forward C that should be buildable very easily with nothing but gcc and perhaps make.
Memory in C++ is a leaky abstraction .

Return to “Off topic discussion”