Hi, everybody,
Got a bit of a mental block here, hope somebody can point me the right way. Here's what I'm thinking:
WinXP needs a driver to use an NTFS file system.
The driver is an external file (ntfs.sys, I believe).
If WinXP is on an ntfs partition, then how can it load the driver (which needs to be found in the filesystem if it's to be loaded) in the first place? It seems to me it would need to load the ntfs driver before it could actually find and load the ntfs driver?
And if it has inbuilt NTFS capabilities, then why bother with a driver at all?
I started thinking about this while fleshing out a design for an OS I'd like to make. The idea was that filesystem support could be loaded through external modules only (nothing hardcoded in the kernel). The kernel would detect all logical storage devices, query the registered filesystem drivers to see which one can handle each device, and use the drivers to access the storage devices in an abstracted manner.
That lead me to the problem - can't load any filesystem modules without accessing the filesystem first. Then I thought of windows ...
Perhaps a custom bootloader can be made to detect the filesystem and load the first driver into memory for the kernel but that would render the whole idea useless.
So, how does Windows does this? Anybody know?
How can winxp load its ntfs driver from an ntfs filesystem?
- kataklinger
- Member
- Posts: 381
- Joined: Fri Nov 04, 2005 12:00 am
- Location: Serbia
http://en.wikipedia.org/wiki/Windows_NT_startup_processNtldr starts the appropriate minifile system drivers; these are built into Ntldr to find and load Windows NT from different file system formats (FAT, NTFS).
kirsis,
The solution is quite simple actually. How about have something that supports the ntfs filesystem load everything needed to get the system up and running.
When a partition is made bootable at format, the utility provides a bootsector capable of reading an NTFS parition, as it is done during Windows installation. The same goes for when you format to other filesystems; generally each bootsector is specific to a target filesystem format. This is due to the limited amount of space available to the bootsectors code, well of course, unless the bootsector code supports spanning multiple sectors.
So here is an overview of how it is achieved.
1) Bootsector from HD is executed, which support NTFS.
2) Bootsector loads NTLDR from an NTFS partition and passes execution to it.
3) NTLDR then determines what filesystem it is being loaded from, which in our case is NTFS, and then continues loading Windows as usual.
Nothing special here.
The solution is quite simple actually. How about have something that supports the ntfs filesystem load everything needed to get the system up and running.
When a partition is made bootable at format, the utility provides a bootsector capable of reading an NTFS parition, as it is done during Windows installation. The same goes for when you format to other filesystems; generally each bootsector is specific to a target filesystem format. This is due to the limited amount of space available to the bootsectors code, well of course, unless the bootsector code supports spanning multiple sectors.
So here is an overview of how it is achieved.
1) Bootsector from HD is executed, which support NTFS.
2) Bootsector loads NTLDR from an NTFS partition and passes execution to it.
3) NTLDR then determines what filesystem it is being loaded from, which in our case is NTFS, and then continues loading Windows as usual.
Nothing special here.
-
- Member
- Posts: 368
- Joined: Sun Sep 23, 2007 4:52 am
A way to do this is to only support filesystems as loadable modules (as you want) and have the bootloader load an "initial ramdisk" with the filesystem and disk drivers.
See: http://en.wikipedia.org/wiki/Initrd
See: http://en.wikipedia.org/wiki/Initrd
Thanks for the pointer, I'll look into this. Looks like what I was afterCraze Frog wrote:A way to do this is to only support filesystems as loadable modules (as you want) and have the bootloader load an "initial ramdisk" with the filesystem and disk drivers.
See: http://en.wikipedia.org/wiki/Initrd
Thanks for the info, I was under the impression that at least a complete read-only driver was required to load a file.Dex wrote:There is a big differance, from loading file X from say ntfs and a full capable ntfs driver. You could for example load file X from a ntfs partion in about 30 lines of asm code.
I wasn't aware that loading a simple file is relatively simple and does not require a fleshed out filesystem driver (as Dex pointed out), so I didn't see the benefit in making a boot loader that contains all the required code to access the filesystem. Might as well put it in the kernel in that case and not bother with modularity.Jeffrey wrote:The solution is quite simple actually. How about have something that supports the ntfs filesystem load everything needed to get the system up and running.
When a partition is made bootable at format, the utility provides a bootsector capable of reading an NTFS parition, as it is done during Windows installation. The same goes for when you format to other filesystems; generally each bootsector is specific to a target filesystem format. This is due to the limited amount of space available to the bootsectors code, well of course, unless the bootsector code supports spanning multiple sectors.
So here is an overview of how it is achieved.
1) Bootsector from HD is executed, which support NTFS.
2) Bootsector loads NTLDR from an NTFS partition and passes execution to it.
3) NTLDR then determines what filesystem it is being loaded from, which in our case is NTFS, and then continues loading Windows as usual.
Nothing special here.
All in all, thanks for your answers, gonna go read up on initial ramdisks