Page 1 of 1

AgaresOS - please review

Posted: Wed Jul 22, 2015 2:46 am
by Agares
Hello!
I am working on AgaresOS, an operating system of my own (well, that was unexpected). I would be glad if someone could review the code, maybe point out some of the stupid things I do. You can find the code here: https://github.com/Agares/AgaresOS/tree ... tion-to-64 (the branch I'm linking to is the most up to date one). One thing I know for sure is that paging won't work if the tables are not identity-mapped. My plans for the nearest future are to fix paging, finish the ELF loader and load the kernel from the loader. Then I think I will work on ACPI.

Re: AgaresOS - please review

Posted: Wed Jul 22, 2015 11:38 am
by Combuster
You probably like games, no?

Code: Select all

#pragma
With these certain earlier versions of gcc, if you compiled a file containing a #pragma, GCC would attempt each of the following in turn:

Attempt to launch a game of nethack.
Attempt to launch a game of rogue.
Attempt to launch a game of Towers of Hanoi via emacs.
Print the message "You are in a maze of twisty compiler features, all different."
Especially since you're often using pragma to hide bad coding manners.


Some other bits that are bound to haunt you sometime:
- No cross-compiler
- Calling make for individual files


Github search doesn't list any references to CR0, CR3, or WRMSR so it means some essential paging things are sadly missing.

Re: AgaresOS - please review

Posted: Wed Jul 22, 2015 11:47 am
by iansjack
Combuster wrote:Github search doesn't list any references to CR0, CR3, or WRMSR so it means some essential paging things are sadly missing.
You didn't look very hard.

It's probably better to rely on eyeballs rather than an inaccurate search (especially if you don't allow for lower case). I also think it's worth making the effort to try to keep criticism accurate (or else don't bother).

Re: AgaresOS - please review

Posted: Wed Jul 22, 2015 12:55 pm
by Combuster
I did try three of the four capitalisation options for the CRs before I posted it, and the fourth for the sole reason that you complained. Regardless, my observation is accurate even though it only proved how broken that search feature is, and misleadingly so considering "jmp far" as the search query does return hits. You're free to repeat my exercise.

Re: AgaresOS - please review

Posted: Wed Jul 22, 2015 1:28 pm
by iansjack
Don't bother with searches (which obviously aren't working for you). If you just look at the source the places where those registers are read and written is obvious.

If you want to criticize source code a good starting point is to read it.

Re: AgaresOS - please review

Posted: Wed Jul 22, 2015 3:14 pm
by Roman
Why is there a .gitkeep file in /common/src? This directory isn't empty.

Re: AgaresOS - please review

Posted: Wed Jul 22, 2015 3:55 pm
by iansjack
Roman wrote:Why is there a .gitkeep file in /common/src? This directory isn't empty.
The commit history shows that that wasn't always the case.

Re: AgaresOS - please review

Posted: Thu Jul 23, 2015 1:56 am
by Agares
Combuster wrote:You probably like games, no?

Code: Select all

#pragma
Well, compiling this code with an ancient version of GCC probably isn't going to end well anyway.
Combuster wrote: Some other bits that are bound to haunt you sometime:
- No cross-compiler
- Calling make for individual files
Yup, you are right here, the whole build system isn't the greatest at the moment.
Combuster wrote: Github search doesn't list any references to CR0, CR3, or WRMSR so it means some essential paging things are sadly missing.
Well, you can find them in common/src/cpu.c
Roman wrote:Why is there a .gitkeep file in /common/src? This directory isn't empty.
The directory was empty, but now isn't, I'll delete that file, thanks.

Thanks for all the answers, I'm going to fix the bugs/problems that you pointed out.