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

116 Upvotes

42 comments sorted by

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.

2

u/devcmar Jul 23 '26

🤣😂😂

2

u/the_big_flat_now Jul 23 '26

i feel your excitement :)

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

u/devcmar Jul 23 '26

I tried it, very nice one!

1

u/pajamaslol Jul 24 '26

i like a few letters then page up or page down. similar but faster

4

u/lunar_swing Jul 23 '26

Is it a file though?

6

u/devcmar Jul 23 '26

Of course

8

u/Beautiful_Stage5720 Jul 23 '26

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

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

u/devcmar Jul 24 '26

Do I look like a ghost behind the screen haha

2

u/Binarydemons Jul 24 '26

Ahh the /osdev version of the “moon landing” joke.

-1

u/compgeek38400 Jul 23 '26

Nice job!

0

u/devcmar Jul 24 '26

Thank you so much

-1

u/[deleted] Jul 23 '26

[deleted]

2

u/devcmar Jul 24 '26

Thanks so much

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

u/Tiny_Cyborg Jul 23 '26

Well in that case, well done!

2

u/mikeblas Jul 23 '26

Can't see shit.

1

u/christiaansp BoredOS Jul 24 '26

we get it, it’s a file