OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 8:55 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 109 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8
Author Message
 Post subject: Re: Rewrite from Scratch
PostPosted: Mon Dec 24, 2012 5:24 pm 
Offline
Member
Member
User avatar

Joined: Thu Jul 26, 2007 1:53 am
Posts: 395
This was very cool! =) Dont worry about the english, I understood it all.

I liked the books you showed at the end. I'm thinking of buying the ARM assembly and Beyond BIOS book since these are the areas in which I lack a lot of knowledge. Would you recommend them?

The OS seems nice, keep up the good work.

_________________
Fudge - Simplicity, clarity and speed.
http://github.com/Jezze/fudge/


Top
 Profile  
 
 Post subject: Re: Rewrite from Scratch
PostPosted: Mon Dec 24, 2012 8:07 pm 
Offline
Member
Member
User avatar

Joined: Tue Jun 02, 2009 4:35 pm
Posts: 737
Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.
Yo:
Kevin wrote:
Quote:
For me, what comes next is attempting to create something that does surpass existing OSs. For this "good enough" isn't even close to adequate. An OS is like a hierarchy of abstractions (e.g. boot code, with kernel/s on top of that, with drivers on top of that, with things like VFS and GUI on top of that, with applications and things on top of that). If one piece is only "good enough" (not even close to adequate) then it's far better to replace it with something that actually is adequate before too much depends on it (or to put it another way; you don't build a sky-scraper on sand). Until I reach the point where I'm unable to think of a way to improve the design of the boot code, I refuse to bother with the kernel.

As you write your kernel only as a hobby, you can choose to do it this way. You'll never get a working OS this way, because there's always something to improve in each layer, but there's no requirement that a hobby project ever creates a final product. So, yes, that may be a fine way for you. It probably doesn't work quite as well if you want to get a result in the forseeable future.


While I always, always try to have the most holistic design that takes as many generalized and specific hardware cases into consideration, it is almost inevitable that I will come back to even "perfectly" designed code and have to make changes, if not do large re-designs iterations.

It is the fact that I am (self-assertion) very strong in kernel design that ensures that when I do need to change something, it can be done quickly, smoothly and efficiently. Both sides of this argument are "correct", from my experience: you don't proceed until you have the most perfect design you can have for the component you need to code, with the information currently available to you; but you will also inevitably have to return to even the most pristinely conceptualized of code to change it as more perfect, and in-depth design takes place in later components.

I stopped "re-writing" long ago. Version control in, halts to progress out.

Thorough research -> perfect design to the extent possible with the information available at the current stage -> move on to next stage -> repeat.

EDIT: Basically, this:
Love4Boobies wrote:
A good design would have to be flexible enough to allow for the requirements to change over time.

My approach to design is: The level of perfection of a design is directly related to the scope of the factors, knowledge and requirements it takes into consideration. It is impossible to achieve truly lastingly perfect design. The only thing that is possible is perfection of design within the ambits of the current scope of known and predictable factors.

--Peace out,
gravaera

_________________
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.


Top
 Profile  
 
 Post subject: Re: Rewrite from Scratch
PostPosted: Tue Dec 25, 2012 1:09 am 
Offline
Member
Member

Joined: Thu Jul 05, 2012 5:12 am
Posts: 923
Location: Finland
Jezze wrote:
I'm thinking of buying the ARM assembly and Beyond BIOS book since these are the areas in which I lack a lot of knowledge. Would you recommend them?


Currently, I am not very familiar with the ARM assembly so I cannot say whether that book is the best one. At least it helped me to understand the basics of it. However, I have not written any useful ARM assembly yet.

Beyond BIOS is good but not great. It is not a reference manual but it gives nice background information of the whole UEFI architecture. Nevertheless, with that book and Phoenix wiki*, I was able to write a bootloader and that is all I need from UEFI for now.

*(http://wiki.phoenix.com/wiki/index.php/EFI_SYSTEM_TABLE)

In the video, executing the following code took long time (UEFI booting). VirtualBox CD icon was just blinking. I do not have real hardware.

Code:
/*
* http://wiki.phoenix.com/wiki/index.php/EFI_BLOCK_IO_PROTOCOL#ReadBlocks.28.29
*
* typedef
* EFI_STATUS
* (EFIAPI *EFI_BLOCK_READ) (
*   IN EFI_BLOCK_IO_PROTOCOL *This,
*   IN UINT32 MediaId,
*   IN EFI_LBA LBA,
*   IN UINTN BufferSize,
*   OUT VOID *Buffer);
*/

   /* Read Blocks */
   movq SystemBufferPointer(%rip), %rax
   xorq %rdx, %rdx
   pushq %rdx /* Alignment */
   pushq %rax /* SystemBuffer */
   pushq %rdx /* Shadow parameters (Microsoft x64 calling convention) */
   pushq %rdx
   pushq %rdx
   pushq %rdx

   movq BlockIoPointer(%rip), %rcx
   movq MediaId(%rip), %rdx
   movq SystemOffset(%rip), %r8
   movq $IMAGE_SIZE, %r9
   callq *EFI_BLOCK_IO_PROTOCOL_ReadBlocks(%rcx)
   cmpq $0x00, %rax
   jne ReadBlocksError

_________________
Undefined behavior since 2012


Top
 Profile  
 
 Post subject: Re: Rewrite from Scratch
PostPosted: Tue Dec 25, 2012 7:27 am 
Offline
Member
Member

Joined: Sun Feb 01, 2009 6:11 am
Posts: 1070
Location: Germany
Nice video. Maybe we should have a separate thread for this, like the one for screenshots.

I almost feel like creating a tyndur video now. Except that I don't really know which parts to show (really small OSes have their advantages in that respect...), that I can't do this nice Finnish (?) accent and that even then I probably wouldn't feel like publishing it. ;)

_________________
Developer of tyndur - community OS of Lowlevel (German)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 109 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 19 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