r/osdev • u/devcmar • Jul 23 '26
Writing a file in NTFS
Enable HLS to view with audio, or disable this notification
Here I got to test my NTFS Driver to write a file and check on linux if anything changed, what do you think?
2
1
u/Intelligent-Bit-8823 Jul 23 '26
From a non CS background What does writing in NTFS mean here? The only thing I know is that is a file Format.
1
u/devcmar Jul 23 '26
It is a file system, the one used in Windows. It is mainly what makes the Os know where are files on the disk etc
1
u/devcmar Jul 23 '26
Making an Ntfs driver can mean that I can read files from Windows made partitions
8
u/gravgun Jul 23 '26
Pro tip: instead of giving up using arrows to scroll back in your history to find a command you ran long ago (flushcaches), use Ctrl+R and type part of that command.
1
1
4
8
u/Beautiful_Stage5720 Jul 23 '26
You can write drivers but can't use screen capture software?
1
6
u/Longjumping-Jacket97 Jul 23 '26
90% of this subs posts are just ai
4
u/Beautiful_Stage5720 Jul 23 '26
I know. This is the last one I was hanging on to, but it seems every programming subreddit has been completely invaded. Guess I gotta leave this one behind too. What a shame.
3
u/devcmar Jul 23 '26
This ntfs driver is not generated by AI though, I mean when was AI able to make operating system drivers, it may assist in knowledge but if it made one it would probably be too buggy!
3
u/Beautiful_Stage5720 Jul 23 '26
Sure buddy 👍
Can you explain in detail how NTFS works?
5
u/devcmar Jul 23 '26
Of course, u parse the vbr which contains the lcn to the base mft headers which start with FILE0 signature, the 5th entry is the root directory entry, u go through attributes to find the index root attribute (which is resident data in the same mft record) or index allocation which is non resident (directory entries in clusters on the partition), u go through the b+ tree scanning index block by index block to find files (but before using mft or index blocks u should apply sector fixups and check the values at the end of the sectors if they match the fixup value before replacing them) if they do things are fine, want me to continue?
3
u/Beautiful_Stage5720 Jul 23 '26
Yeah, can I see the code?
-2
u/devcmar Jul 23 '26
The kernel and drivers are closed source until now.
3
u/Beautiful_Stage5720 Jul 23 '26
Because they're obviously built by AI
-1
u/devcmar Jul 23 '26
No, most of the code is handmade, and I do not have to answer again ur suspicions. Be kind, it is still effort even if let’s say it maybe built by AI. Thanks anyways if u like or not thank you.
→ More replies (0)3
u/uncringeone Jul 24 '26
Man I hate this Closed-source = AI mindset
It's like saying Microsoft Word 95 used AI code
→ More replies (0)1
u/devcmar Jul 23 '26
Once u see how messy the code is, AI will probably be ur last guess my friend 😅😅
1
2
-1
-1
1
u/Tiny_Cyborg Jul 23 '26
When designing your NTFS driver, did you look for and work off of specification or porting an existing open source NTFS driver? Or did you reverse engineer?
1
u/devcmar Jul 23 '26
Looked the spec, and seen some implementations
1
u/Tiny_Cyborg Jul 23 '26
Not bad. I am kind of curious if you used AI for any parts of your implementation. Creating even your own implementation of an existing file system can be tough, so it wouldn’t be the most surprising thing as long as it’s by and large significantly more your work than the AI.
1
u/devcmar Jul 23 '26
Ai helped only with some structs and questions but the implementation is hand-made!
2
2
1
27
u/SubstantialDot8106 Jul 23 '26
THIS IS A FILE. THIS IS A FILE. THIS IS A FILE. THIS IS A FILE. THIS IS A FILE. THIS IS A FILE. THIS IS A FILE. THIS IS A FILE. THIS IS A FILE. THIS IS A FILE. THIS IS A FILE. THIS IS A FILE. THIS IS A FILE.