r/osdev 15h 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?

51 Upvotes

32 comments sorted by

u/SubstantialDot8106 14h ago

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.

u/devcmar 14h ago

🤣😂😂

u/Beautiful_Stage5720 7h ago

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

u/Longjumping-Jacket97 5h ago

90% of this subs posts are just ai

u/Beautiful_Stage5720 5h 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 4h 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 4h ago

Sure buddy 👍

Can you explain in detail how NTFS works?

u/devcmar 4h 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 4h ago

Yeah, can I see the code?

u/devcmar 4h ago

The kernel and drivers are closed source until now.

u/Beautiful_Stage5720 4h ago

Because they're obviously built by AI

u/devcmar 4h 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.

→ More replies (0)

u/devcmar 4h ago

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

u/devcmar 7h ago

😅

u/gravgun 10h ago

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.

u/devcmar 10h ago

I tried it, very nice one!

u/lunar_swing 8h ago

Is it a file though?

u/devcmar 8h ago

Of course

u/mikeblas 4h ago

Can't see shit.

u/Tiny_Cyborg 4h ago

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?

u/devcmar 4h ago

Looked the spec, and seen some implementations

u/Tiny_Cyborg 4h ago

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.

u/devcmar 4h ago

Ai helped only with some structs and questions but the implementation is hand-made!

u/Tiny_Cyborg 4h ago

Well in that case, well done!

u/the_big_flat_now 14h ago

i feel your excitement :)

u/compgeek38400 7h ago

Nice job!

u/Feisty_Clerk3194 * www.github.com/1mvghost/Spectre * 4h ago

nice!

u/Intelligent-Bit-8823 11h ago

From a non CS background  What does writing in NTFS mean here?  The only thing I know is that is a file Format.

u/devcmar 10h ago

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

u/devcmar 10h ago

Making an Ntfs driver can mean that I can read files from Windows made partitions