what do i have to do?
what do i have to do?
i havnt done much work, because im building a new computer, and i want to write this under linux using gcc, and right now i have a boot loader and test kernel which dont work under bohcs, but under a real pc, the boot loader loads teh kernel, which dosnt do what its supposed to. i also have a theoretical file system down. but what do i need to do after i boot? how do i make a gtd, idt, and any other dt i have to make. im gonna use paging, although i dotn really understand it, at least its implication. also, do i have to write a dirver for every piece of hardware? like the kbd, monitor, harddrive, floppy, and store their addresses in the idt? shoudl i reserve teh first meg of RAM for driver code? what do i have to do before im in a pmode enviroment, all set up where i can run the kernel?
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:what do i have to do?
this makes alot of questions ...
I guess the next step after you entered protected mode will be to set up a clean environment you'll be working in (having interrupts working, having memory set up so that it fits your needs, etc.)
And, yes, you'll basically have to re-write a lot of drivers except if you find yourself able to simulate them from some other OS (for instance running a Linux driver module in your own system, or a Win .DLL driver, or an UDI driver ...
I suggest you read more on paging and its use before you start implementing it, but if you want things to be simple, you can decide to lock some memory for your kernel by mapping it at well-known location and leaving the rest of page management to further program loader ...
I guess the next step after you entered protected mode will be to set up a clean environment you'll be working in (having interrupts working, having memory set up so that it fits your needs, etc.)
And, yes, you'll basically have to re-write a lot of drivers except if you find yourself able to simulate them from some other OS (for instance running a Linux driver module in your own system, or a Win .DLL driver, or an UDI driver ...
I suggest you read more on paging and its use before you start implementing it, but if you want things to be simple, you can decide to lock some memory for your kernel by mapping it at well-known location and leaving the rest of page management to further program loader ...
Re:what do i have to do?
well i think i knwo how paging works, just no details. memory is divided into 4kb segments, given out to progs, who address the first byte in the segment, as 0x000000, even though it coudl be in the gigabyte range. but hwo they use more than one page?
Re:what do i have to do?
You are confusing paging and segmentation.
Segmentation is where a selector (i.e. segment register) is used to mark an address range that will be used for code/data use, this segment may start anywhere in memory (as long as memory is set up accordingly) and the first byte is addressed as 0x00000000. I.e. you could have a segment that starts at the 1GB mark, but the first byte in that segment (i.e. at the 1GB mark) would be accessed as 0x00000000.
Paging is effectively a mechanism whereby the processor divides up memory into 4KB chunks. These 4KB chunks are then setup using page directories and page tables. To be honest this is a topic that is definately worth googling for more information or read up in a book (my personal recommendation is the Silberschatz Operating Systems concepts 6th edition, which explains everything very well)
Actually, the same as most threads on this forum, *always* buy a book or two on os design, it probably won't help with actual implementation but it really helps with getting the concepts clear in the mind, believe me!!
Segmentation is where a selector (i.e. segment register) is used to mark an address range that will be used for code/data use, this segment may start anywhere in memory (as long as memory is set up accordingly) and the first byte is addressed as 0x00000000. I.e. you could have a segment that starts at the 1GB mark, but the first byte in that segment (i.e. at the 1GB mark) would be accessed as 0x00000000.
Paging is effectively a mechanism whereby the processor divides up memory into 4KB chunks. These 4KB chunks are then setup using page directories and page tables. To be honest this is a topic that is definately worth googling for more information or read up in a book (my personal recommendation is the Silberschatz Operating Systems concepts 6th edition, which explains everything very well)
Actually, the same as most threads on this forum, *always* buy a book or two on os design, it probably won't help with actual implementation but it really helps with getting the concepts clear in the mind, believe me!!