Re: FUSE filesystem?
Posted: Tue Nov 16, 2021 8:59 am
Hi. So then, what filesystem should I use? I thought about FAT12, but it is hard to find documentation. I thought about USTAR (as the main filesystem). What should I use?
Wat? FAT12 is one of the best-documented file systems on the planet. You can look at the Wikipedia article about it, our Wiki article on it, Ralf Brown's interrupt list, et cetera. Merely typing it into the search engine of your least distrust should reveal a treasure trove of documentation.zap8600 wrote:So then, what filesystem should I use? I thought about FAT12, but it is hard to find documentation.
Well, what do you want from a file system? Personally, I'd suggest ext2 for starters, then upgrade to ext3 and ext4 later. Rome wasn't built in a day, either. But then, I am developing on Linux and have a couple of implementations available to cross-check my own. I am also creating a Unix OS, so ext2 fits nicely.zap8600 wrote: What should I use?
Code: Select all
bit32s name(struct DEVICE_ENTRY *, bit16u, bit64u, bit64u, void *)
Code: Select all
bit32s name(bit32u serv, bit64u qword0, bit32u dword1, bit64u qword2, void *ptr0, void *ptr1)
When using IDE drivers, especially older hardware, you should only read and write 16-bit words, and not via a 'string' instruction. When reading in a sector, you should have a loop that does the following:zap8600 wrote:Hi. Sorry I haven't posted in a while. I have been researching IDE drives. I actually might have a solution. The only problem is that I need port commands called outsl and insl. I don't get how to implement this. I'm also having trouble finding information about it. Could somebody help me?
Code: Select all
i = 0
(A)
BUFFER[i] = IN 16-bit WORD
i = i + 1
LOOP (A) IF i < 256
I'm curious where this advice comes from. Every BIOS I've looked at all the way back to the IBM 5170 uses REP INSW and REP OUTSW in the INT 0x13 handler, and the old Linux IDE driver uses them too.BenLunt wrote:When using IDE drivers, especially older hardware, you should only read and write 16-bit words, and not via a 'string' instruction.
Drives don't handle 32-bit access, HBAs do. Ignore what the drive says and check whether the HBA supports 32-bit access by looking up its datasheet using the PCI vendor and device IDs. (This is a leftover from ESDI controllers. With ESDI, the controller responds to IDENTIFY DEVICE instead of the drive, so the information here would tell you the controller's capabilities.)BenLunt wrote:2) on a PCI bus, and if the ATA(PI) version is 7 or less, you can check the IDENTIFY BLOCK to see if the drive handles 32-bit DWORD access (Bit 0 of Word 48).
Please note that I specified 'especially older hardware'. When I wrote my IDE code, the year still started with 19xx, not 20xx. :-) My notes don't specify a source, but they simply state that some older hardware didn't like the 'string' instructions. Sorry.Octocontrabass wrote:I'm curious where this advice comes from. Every BIOS I've looked at all the way back to the IBM 5170 uses REP INSW and REP OUTSW in the INT 0x13 handler, and the old Linux IDE driver uses them too.BenLunt wrote:When using IDE drivers, especially older hardware, you should only read and write 16-bit words, and not via a 'string' instruction.
Sorry, yes, you are correct. It is the controller, not the drive. I inadvertently used the wrong term here. Thanks for the correction.Octocontrabass wrote:Drives don't handle 32-bit access, HBAs do.BenLunt wrote:2) on a PCI bus, and if the ATA(PI) version is 7 or less, you can check the IDENTIFY BLOCK to see if the drive handles 32-bit DWORD access (Bit 0 of Word 48).
The controller's data register is an FIFO type register. You read a sequence of words from that register, or write a sequence of words to the register. The controller keeps track of the data. As you probably read, the controller even has a bit indicating if it has data ready or if the controller is ready to receive data.zap8600 wrote:Hi. What I'm wondering is:
1. How do I keep repeating outw and inw to get/send all of the data?
2. How do I keep writing data to the same thing without it being overwritten?
3. What type of variable should I use? void, char, int?
Code: Select all
int words_per_sector = 256; // This really needs to be calculated before-hand
bit16u buffer[256]; // again, words per sector instead of hard coding the 256.
for (int i=0; i<words_per_sector; i++) {
buffer[i] = inpw(DATA_REG);
}
// acknowledge the interrupt.
Yes, I'm talking about ancient history as well. I've looked primarily at early 90s BIOS ROMs and drivers, and I can find no evidence that such buggy hardware existed. (If it really did exist, it wasn't common enough for the authors of the Linux IDE drivers or the Windows WDCTRL driver to stumble across it. I haven't checked ESDI_506 yet...)BenLunt wrote:Please note that I specified 'especially older hardware'. When I wrote my IDE code, the year still started with 19xx, not 20xx.