OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Apr 19, 2024 5:11 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: AgaresOS - please review
PostPosted: Wed Jul 22, 2015 2:46 am 
Offline

Joined: Sat Aug 25, 2012 4:19 pm
Posts: 18
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.


Top
 Profile  
 
 Post subject: Re: AgaresOS - please review
PostPosted: Wed Jul 22, 2015 11:38 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
You probably like games, no?
Code:
#pragma
Quote:
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.

_________________
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]


Top
 Profile  
 
 Post subject: Re: AgaresOS - please review
PostPosted: Wed Jul 22, 2015 11:47 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4594
Location: Chichester, UK
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).


Top
 Profile  
 
 Post subject: Re: AgaresOS - please review
PostPosted: Wed Jul 22, 2015 12:55 pm 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
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.

_________________
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]


Top
 Profile  
 
 Post subject: Re: AgaresOS - please review
PostPosted: Wed Jul 22, 2015 1:28 pm 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4594
Location: Chichester, UK
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.


Top
 Profile  
 
 Post subject: Re: AgaresOS - please review
PostPosted: Wed Jul 22, 2015 3:14 pm 
Offline
Member
Member
User avatar

Joined: Thu Mar 27, 2014 3:57 am
Posts: 568
Location: Moscow, Russia
Why is there a .gitkeep file in /common/src? This directory isn't empty.

_________________
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay


Top
 Profile  
 
 Post subject: Re: AgaresOS - please review
PostPosted: Wed Jul 22, 2015 3:55 pm 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4594
Location: Chichester, UK
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.


Top
 Profile  
 
 Post subject: Re: AgaresOS - please review
PostPosted: Thu Jul 23, 2015 1:56 am 
Offline

Joined: Sat Aug 25, 2012 4:19 pm
Posts: 18
Combuster wrote:
You probably like games, no?
Code:
#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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 80 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group