Getting Started (double entendre!)
-
- Member
- Posts: 204
- Joined: Thu Apr 12, 2007 8:15 am
- Location: Michigan
A few more questions I realized about partition tables as I started:
I tried a search on partition tables.... doesn't the CHS format of the partition tables limit to 8.4 GB partitions? There are LBA values, and they are 32-bits... which allows for drives up to 2 TB's, so I don't think I need to worry about this (until I start worrying about RAID, etc), HOWEVER, if LBA48 isn't supported, then LBA28 limits us down to 137 GB's. How is it that I can have a 500 GB hard drive, with a partition starting at 250 GB's? This is larger than any CHS value or LBA value in the partition table can describe!
I thought I came across a partition table document that talked about using 48-bit fields for partitions (or something like that) but I can't seem to find it
I tried a search on partition tables.... doesn't the CHS format of the partition tables limit to 8.4 GB partitions? There are LBA values, and they are 32-bits... which allows for drives up to 2 TB's, so I don't think I need to worry about this (until I start worrying about RAID, etc), HOWEVER, if LBA48 isn't supported, then LBA28 limits us down to 137 GB's. How is it that I can have a 500 GB hard drive, with a partition starting at 250 GB's? This is larger than any CHS value or LBA value in the partition table can describe!
I thought I came across a partition table document that talked about using 48-bit fields for partitions (or something like that) but I can't seem to find it
- mathematician
- Member
- Posts: 437
- Joined: Fri Dec 15, 2006 5:26 pm
- Location: Church Stretton Uk
It's just my opinion, but I think you could save yourself a lot of trouble if, MS-DOS style, you had your second stage loader at a fixed location in the root directory and on the disk. If you are worried about somebody accidentally deleting it, then make sure they can't. Have a flag in the directory for files which absolutely must not be deleted, and make sure that there is no system call which would allow the user to clear that flag. Or simply have the system recognise the files which mustn't be deleted either by name, or with an appropriately sophisticated checksum.
Just my opinion.
Just my opinion.
-
- Member
- Posts: 204
- Joined: Thu Apr 12, 2007 8:15 am
- Location: Michigan
Suppose they delete it from another OS with the standard ext2 driver (since, there really isn't such a flag). They should be able to fix it by simply placing it back on the drive in the correct location.mathematician wrote:It's just my opinion, but I think you could save yourself a lot of trouble if, MS-DOS style, you had your second stage loader at a fixed location in the root directory and on the disk. If you are worried about somebody accidentally deleting it, then make sure they can't. Have a flag in the directory for files which absolutely must not be deleted, and make sure that there is no system call which would allow the user to clear that flag. Or simply have the system recognise the files which mustn't be deleted either by name, or with an appropriately sophisticated checksum.
Just my opinion.
However, you did give me a good idea:
The partition bootloader should look for the second stage in head 0, track 0 of the drive. If it's not there, it should have an offset of the file on the drive stored, and simply load it from the drive. If it doesn't find the signature there either, it should scan the partition. Still no second stage, then the user must've done something and not fixed it, so display an error.
Of course, when I get into the user-space programs of my OS, I'd make it display warnings upon warnings (or just flat out refuse) if you try to delete important files.
- mathematician
- Member
- Posts: 437
- Joined: Fri Dec 15, 2006 5:26 pm
- Location: Church Stretton Uk
The answer must be that, on drives large enough to require it, LBA48 must be supported, mustn't it? Unless you mean literally that you own a 500gb drive which only supports LBA28.madeofstaples wrote:There are LBA values, and they are 32-bits... which allows for drives up to 2 TB's, so I don't think I need to worry about this (until I start worrying about RAID, etc), HOWEVER, if LBA48 isn't supported, then LBA28 limits us down to 137 GB's.
Once drives get beyond 2Tb I suppose they will have to redesign partition tables; with something to indicate that this is a "new style" parttion table with CHS values no longer present, but with potentially huge LBA values.
-
- Member
- Posts: 204
- Joined: Thu Apr 12, 2007 8:15 am
- Location: Michigan
Err, my 500 GB drive probably supports LBA48... I guess I was just confused about how, if you only have LBA28, then you can only use 28 of the 32 bits, but if you have LBA48, the bottlekneck becomes the 32 bits, but I get it now... so should I just ignore the CHS values, then?mathematician wrote:The answer must be that, on drives large enough to require it, LBA48 must be supported, mustn't it? Unless you mean literally that you own a 500gb drive which only supports LBA28.madeofstaples wrote:There are LBA values, and they are 32-bits... which allows for drives up to 2 TB's, so I don't think I need to worry about this (until I start worrying about RAID, etc), HOWEVER, if LBA48 isn't supported, then LBA28 limits us down to 137 GB's.
Once drives get beyond 2Tb I suppose they will have to redesign partition tables; with something to indicate that this is a "new style" parttion table with CHS values no longer present, but with potentially huge LBA values.
Also, should I display an error if the partition I need to access has more than 28 bits set in the LBA offset or length fields when there's no LBA48 support? Or can I trust that this never happens?
what happens to the CHS values when a partition starts and/or ends after the 8.4 GB barrier?
- mathematician
- Member
- Posts: 437
- Joined: Fri Dec 15, 2006 5:26 pm
- Location: Church Stretton Uk
Although we write operating systems with the hypothesis that people other than ourselves will be using it once it is finished, but also with the knowledge that, in 99% of cases, that won't be the case. As much as it pains me to say it.
Unless you have a really new idea, and that really new idea has a potential market large enough to at least keep you fed and watered.
Unless you have a really new idea, and that really new idea has a potential market large enough to at least keep you fed and watered.
- mathematician
- Member
- Posts: 437
- Joined: Fri Dec 15, 2006 5:26 pm
- Location: Church Stretton Uk
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Don't be so negative... You can always leave.. nobody is begging you to staymathematician wrote:Although we write operating systems with the hypothesis that people other than ourselves will be using it once it is finished, but also with the knowledge that, in 99% of cases, that won't be the case. As much as it pains me to say it.
Unless you have a really new idea, and that really new idea has a potential market large enough to at least keep you fed and watered.
-
- Member
- Posts: 204
- Joined: Thu Apr 12, 2007 8:15 am
- Location: Michigan
- mathematician
- Member
- Posts: 437
- Joined: Fri Dec 15, 2006 5:26 pm
- Location: Church Stretton Uk
You seem to want your security to be tighter than that on any commercially available operating system. but there is only so much you can do to protect people from themselves. If I really wanted to I could go to the Windows system folder, and delete the file system, or something stupid like that, but I have no intention of doing so. It is hard to see why anybody else would arbitrarily delete a file whose purpose thay perhaps have no idea of (except that it resides in a system folder). If they do..... well like I say, there is only so much you can do to protect them from themselves.
Won't the ext2 file system let you hide files/folders? If it won't maybe you could put most of the really critical stuff on a hidden partition.
Won't the ext2 file system let you hide files/folders? If it won't maybe you could put most of the really critical stuff on a hidden partition.
I don't have much time, but just want to tell you of a small project I started called SecOS, which was an OS in a bootsector...it might give you a bit of some hints or something as to how to code for small sizes...
it's website link is at http://jouleos.galekus.com/secos.php
it unfortunately only does floppy booting..(or at least floppy reading)
it's website link is at http://jouleos.galekus.com/secos.php
it unfortunately only does floppy booting..(or at least floppy reading)
-
- Member
- Posts: 204
- Joined: Thu Apr 12, 2007 8:15 am
- Location: Michigan
Although it's probably true, thinking like that when writing anything will just cement the fact.mathematician wrote:Although we write operating systems with the hypothesis that people other than ourselves will be using it once it is finished, but also with the knowledge that, in 99% of cases, that won't be the case. As much as it pains me to say it.
Unless you have a really new idea, and that really new idea has a potential market large enough to at least keep you fed and watered.
Point taken, maybe I'll just write a bootloader that loads from a static position on the hard drive, and perhaps later I can go back and add security policies to keep it from being tampered with.mathematician wrote:You seem to want your security to be tighter than that on any commercially available operating system. but there is only so much you can do to protect people from themselves.
Because I think an OS should definitely be designed to protect it's own bootcode, but it shouldn't be designed to limit the user (so if the user really wants to destroy things, he/she can).
I've seen your project while browsing through these forums, it looks very interesting, but I haven't taken a look at your code. Will do, thanks.hckr83 wrote:I don't have much time, but just want to tell you of a small project I started called SecOS, which was an OS in a bootsector...it might give you a bit of some hints or something as to how to code for small sizes...
it's website link is at http://jouleos.galekus.com/secos.php
it unfortunately only does floppy booting..(or at least floppy reading)