Hi
bewing wrote:
Intel has won the chip wars for 32 bit CPUs, so I am going to be designing specifically for the P6 family for now. When the 64 bit chips become more standardized, I will port to them, also. But I am not designing for portability. In fact, the kernel right now is 160K of NASM assembler, that compiles to 14K of machine language.
Because 64-bit is "new", there's much less backward compatability mess to worry about. 64-bit chips are more standardized now than 32-bit CPUs have been for years, and 64-bit chips will probably become less standardized over time (not more standardized) as different manufacturers add their own new features, like VMX (Intel's virtualization) or SVM (AMD's virtualization).
BTW, how long is it going to take to write your OS and what sort of computers will be around when it's finished? I'm thinking that in 10 years time "many-CPU" NUMA machines will be common, and 32-bit CPUs will be obsolete (except for embedded systems).
bewing wrote:
A file is allocated to the different sized clusters in an efficient way. A file that is exactly 1MB -1 bytes long will be allocated to a 512K cluster, followed by a 256K, 128K, 64K, 32K, 16K, 8K, 4K, 2K, 1K, then 512b cluster. The 511 byte "tail" of the file is stored in the directory entry for the file. This results in 100% disk utilization ... and file fragmentation is theoretically and practically IMPOSSIBLE.
What happens when you've got a 30 MB file and an application appends 2 KB to the end of it? Will you store the extra 2 KB somewhere else on disk (fragment the file), or relocate the entire file somewhere else so that you can add that extra 2 KB to the end without overwriting other data and without fragmenting the file? How much time would it cost to relocate (read and write) 30 MB of data, and how much time would it cost if the file was fragmented?
File fragmentation is bad, but is "no file fragmentation" worse (considering that it's a general file system, not something primarily designed for "write once")?
bewing wrote:
Microsquish has reportedly found that most system crashes are the result of badly written 3rd party device drivers trampling on the kernel's memory area. So I want to implement a 3 ring privilege level scheme, with a small trusted kernel in ring 0, and most interrupt/exception handlers, device drivers, and system utilities in ring 1. User processes run in ring 3, of course.
How will you prevent ring 1 code from trampling on the kernel's memory area? With paging protection there's only "supervisor" and "user" (where supervisor includes ring 2, ring 1 and ring 0).
If you do prevent ring 1 code from trampling on the kernel's memory area, does that mean that ring 1 code will trample on other ring 1 code instead?
Cheers,
Brendan