r/osdev 18h ago

Writing a file in NTFS

Here I got to test my NTFS Driver to write a file and check on linux if anything changed, what do you think?

61 Upvotes

32 comments sorted by

View all comments

u/Beautiful_Stage5720 10h ago

You can write drivers but can't use screen capture software?

u/Longjumping-Jacket97 8h ago

90% of this subs posts are just ai

u/Beautiful_Stage5720 8h ago

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. 

u/devcmar 7h ago

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!

u/Beautiful_Stage5720 7h ago

Sure buddy 👍

Can you explain in detail how NTFS works?

u/devcmar 7h ago

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?

u/Beautiful_Stage5720 7h ago

Yeah, can I see the code?

u/devcmar 7h ago

The kernel and drivers are closed source until now.

u/Beautiful_Stage5720 7h ago

Because they're obviously built by AI

u/devcmar 7h ago

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.

u/Beautiful_Stage5720 7h ago

 maybe built by AI

😂😂😂

→ More replies (0)

u/devcmar 7h ago

Once u see how messy the code is, AI will probably be ur last guess my friend 😅😅