News for hackers. Stuff that matters.
Re:Why is the DOS path character "\"? (2005) by emptyparadise on Friday February 26, 2021 @04:34AM (#26272972)
I really look forward to the day NT's source is released. It's a truly fascinating kernel. Imagine somebody building an entire Unix on top of NT! Like WSL, but even beyond.
Re:Why is the DOS path character "\"? (2005) by sophistc on Friday February 26, 2021 @05:56AM (#26273504)
Re:Why is the DOS path character "\"? (2005) by emptyparadise on Friday February 26, 2021 @06:02AM (#26273538)
Yeah, and WSL1 was something similar, but I was suggesting just Unix here, no Win32. Imagine GNU/NT!
Re:Why is the DOS path character "\"? (2005) by HeckFeck on Friday February 26, 2021 @11:05AM (#26276156)
If someone wanted to attempt this absolute bastardisation of God's will, you could try porting the GNU userland to run atop the ReactOS kernel.

We'd finally have the GPL-licenced microkernel OS of Stallman's dreams.

Re:Why is the DOS path character "\"? (2005) by wruza on Friday February 26, 2021 @10:24AM (#26275648)
Apart from fork() and custom async io (epoll, iocp) aren’t they pretty compatible even without cygwin? GNU relies on POSIX (afair), so wouldn’t NT features be unused extra?
Re:Why is the DOS path character "\"? (2005) by est on Friday February 26, 2021 @04:37AM (#26272993)
Win2k and WinXP source code are leaked if I am not mistaken
Re:Why is the DOS path character "\"? (2005) by ganafagol on Friday February 26, 2021 @04:38AM (#26273006)
Release != leak
Re:Why is the DOS path character "\"? (2005) by minxomat on Friday February 26, 2021 @05:14AM (#26273233)
Even the leaks contain enough of Microsoft's spirit in their comments: https://gist.github.com/turbo/75f0905275c29a3049f983cfe273ea...

;)

Re:Why is the DOS path character "\"? (2005) by emptyparadise on Friday February 26, 2021 @06:06AM (#26273551)
But sadly a lot of interesting fun and research that could be done with this code won't ever see the light of day because lawyers are scary.
Re:Why is the DOS path character "\"? (2005) by john4532452 on Friday February 26, 2021 @04:52AM (#26273088)
What special about NT kernel that's not in linux kernel ?
Re:Why is the DOS path character "\"? (2005) by tinus_hn on Friday February 26, 2021 @05:47AM (#26273451)
* It is (with a lot of ifs and buts) a microkernel

* it is optimized for integration with third party software from people who don’t have the source, so for instance the driver model is interesting

* the built in configuration system (the registry) and how it’s used throughout

* the (underused) personalities system you can use to show different apis to different binaries

* the security model is much more interesting, while in Linux you have ‘root’ and everything else, on Windows this is much more granular (unfortunately it’s so complex it’s basically impossible to use).

The architecture is really quite interesting, even though Microsoft didn’t make a lot of use of a large part of it.

Re:Why is the DOS path character "\"? (2005) by HeckFeck on Friday February 26, 2021 @11:10AM (#26276240)
If I'm not mistaken, the Win32 API is actually a subsystem to the NT kernel. You can call the kernel itself a layer below with functions beginning with 'nt*'.

Hardware is actually mapped as an object namespace, which is presented to the user as the drive letters. This was exposed with Windows XP booting in safe mode; during the boot process it would print file paths as object paths, not drive paths.

Much as I'm more in the *nix way now, there's plenty of curiosities to explore and tinker in Windows.

Re:Why is the DOS path character "\"? (2005) by scaladev on Friday February 26, 2021 @05:51AM (#26273471)
>in Linux you have ‘root’ and everything else

Well, you do have:

- capabilities (which are so coarse-grained as to be practically useless)

- 8 types of namespaces

- seccomp-bpf

- LSM (AppArmor, SELinux, TOMOYO, etc)

Re:Why is the DOS path character "\"? (2005) by pjc50 on Friday February 26, 2021 @06:23AM (#26273657)
The big difference is when you're in a multi-computer (Active Directory / NIS / LDAP) environment. On UNIX all the IDs are smallish integers, so you have to be careful to ensure they're unique and non-overlapping. On Windows you have a "SID" which is variable length and (for users) usually a big random number.

https://docs.microsoft.com/en-us/troubleshoot/windows-server...

Windows also differentiates between the human ADMINISTRATOR account and machine "root" accounts like "LOCALSYSTEM".

User accounts are also disambiguated by "domain"; ADMINISTRATOR on the local machine is not automatically the same as the domain-wide ADMINISTRATOR.

Re:Why is the DOS path character "\"? (2005) by tinus_hn on Friday February 26, 2021 @07:02AM (#26273938)
Linux User IDs since decades are 32 bit integers; you can just use some mapping system to allocate them automatically and you’ll never run out.

The limitation is that there is one user ID, 0 which can do everything and all the other IDs can do almost nothing.

This has nothing to do with domains and everything with the distinction you describe between the Windows Administrator, local system or even more powerful trustedinstaller accounts.

Re:Why is the DOS path character "\"? (2005) by pdw on Friday February 26, 2021 @10:04AM (#26275435)
Compared to Windows SIDs, Linux's 32-bit uid is a "smallish integer"
Re:Why is the DOS path character "\"? (2005) by snuxoll on Friday February 26, 2021 @10:38AM (#26275813)
Yes and no. Bear in mind, a large part of a Windows SID is a namespace - the actual id within that namespace is so far without exception under 32-bits. An entire Active Directory domain (read: single domain, not forest) is actually limited to 2^30 RID's being issued - after which no new accounts (including computer accounts) can be created, period. You can technically unlock an extra bit and issue 2^31 RID's starting with WS2012, but compatibility is a potential issue and MS's documentation says you should only use it while planning a migration to a new domain (and for good reason).

This does technically give Windows some advantage here as SID's are namespaced - you can have multiple domains in a forest, domain trusts, etc - but I don't think as far as realistic number of users accessing a network it makes much of a difference.

Where it does suck on Linux, however, is user namespaces. 32-bits is a lot when it comes to just giving out accounts, but it's nowhere near enough to give every user a 16-bit chunk of accounts for mapping the traditional 0-65535 (because nobody) ranges for use with unprivileged user namespaces. I'd really like to see a push for 64-bit uid/gid's for this reason.

Re:Why is the DOS path character "\"? (2005) by vetinari on Friday February 26, 2021 @10:40AM (#26275825)
And yet in practice the only problem with them is when mapping Windows SID is needed. Otherwise, they are fine.

Also, Windows SIDs are fixed-size 128 bit. They were supposed to be GUIDs, but they are not that random; user SIDs contain common prefix from the domain SID.

Re:Why is the DOS path character "\"? (2005) by raverbashing on Friday February 26, 2021 @05:56AM (#26273505)
Yes though a lot of this came "long after" the NT kernel (at least after NT 4.0)

A lot of innovations on NT are late as well to be fair, like the whole Application Views (?) of the system (basically an FS/Registry app sandboxing)

Re:Why is the DOS path character "\"? (2005) by tinus_hn on Friday February 26, 2021 @06:07AM (#26273561)
This is more like LD_PRELOAD. I’m not sure this is a kernel level feature.
Re:Why is the DOS path character "\"? (2005) by msla on Friday February 26, 2021 @10:14AM (#26275534)
> the (underused) personalities system you can use to show different apis to different binaries

Linux has this, but it is, as you say, underused.

https://man7.org/linux/man-pages/man2/personality.2.html

Re:Why is the DOS path character "\"? (2005) by wruza on Friday February 26, 2021 @10:32AM (#26275742)
The architecture is really quite interesting, even though Microsoft didn’t make a lot of use of a large part of it.

Sadly, that usually means it’s bugged as hell and impossible to use unless you’ve been trained for many years at ms to do that.

Re:Why is the DOS path character "\"? (2005) by macksd on Friday February 26, 2021 @08:50AM (#26274713)
I'm very intrigued by that list. Any recommendations on where to read technical, internal details?
Re:Why is the DOS path character "\"? (2005) by helloooooooo on Friday February 26, 2021 @08:59AM (#26274781)
Windows Internals 7th edition
Re:Why is the DOS path character "\"? (2005) by tinus_hn on Saturday February 27, 2021 @06:34AM (#26284181)
There’s books but also the ReactOS project has been working for many years on replicating the functionality, so you can look at their source.
Re:Why is the DOS path character "\"? (2005) by pjmlp on Friday February 26, 2021 @05:35AM (#26273378)
Object based instead of file handles, with capabilities on everything you can do with them.

Since Vista, official support for a C++ subset.

In kernel IPC, namely LPC, to mimic micro-kernels architectures.

Re:Why is the DOS path character "\"? (2005) by bayindirh on Friday February 26, 2021 @05:13AM (#26273227)
It's a whole different paradigm and a popular one too. Just being able to look into it and get inspired is enough to be excited TBH.
Re:Why is the DOS path character "\"? (2005) by dijit on Friday February 26, 2021 @04:59AM (#26273129)
Re:Why is the DOS path character "\"? (2005) by marcodiego on Friday February 26, 2021 @08:00AM (#26274317)
Almost every time I talked to pseudo nt gurus, IOCP was mentioned as something nt did and linux don't. Now, io_uring seems to have finally closed the gap.
Re:Why is the DOS path character "\"? (2005) by muststopmyths on Friday February 26, 2021 @10:49AM (#26275948)
io_uring is more like RIO, which is better than IOCP if your packet rates are high.
Re:Why is the DOS path character "\"? (2005) by bitcharmer on Friday February 26, 2021 @05:11AM (#26273212)
You mean like epoll on Linux?
Re:Why is the DOS path character "\"? (2005) by tobias3 on Friday February 26, 2021 @05:27AM (#26273332)
No, like io_uring which Linux got in 2019 and still doesn't cover everything yet (e.g. currently mkdirat() is being added). It also often falls back to a kernel-level thread pool, since many e.g. file systems don't implement async IO.
Re:Why is the DOS path character "\"? (2005) by vl on Friday February 26, 2021 @11:34AM (#26276562)
Annoyingly IOCP didn’t cover everything as well - for example, CreateFile of all things!
Re:Why is the DOS path character "\"? (2005) by scaladev on Friday February 26, 2021 @05:44AM (#26273431)
>since many e.g. file systems don't implement async IO

If we're picking on Linux here we should also mention that this issue cannot exist on Windows because it doesn't support anything else besides NTFS and a couple of options dating back to the 18th century or so.

Oh, and WinFS, of course, F being short for future which is like the horizon, or the communism, always out there just a month or two away.

Re:Why is the DOS path character "\"? (2005) by tinus_hn on Friday February 26, 2021 @05:51AM (#26273474)
You can actually for example get drivers for APFS for Windows from third party vendors.
Re:Why is the DOS path character "\"? (2005) by scaladev on Friday February 26, 2021 @05:54AM (#26273489)
Sure, and there are third party drivers for ext* and btrfs and god knows what else… but we're talking about official support here, I think. You can find all sorts of craziness in out-of-tree patches for the Linux kernel.
Re:Why is the DOS path character "\"? (2005) by vl on Friday February 26, 2021 @11:39AM (#26276644)
They also have ReFS - new filesystem in NT Server.
Re:Why is the DOS path character "\"? (2005) by acomjean on Friday February 26, 2021 @10:01AM (#26275403)
My os book in college had an appendies on various OS.

Online the oldest is the 7th edition appendies which has details on A)Unix bsd B)Mach and c)windows 2000.

Windows 2000 was the next version of NT. Interesting if long reads about OS architecture.

http://bcs.wiley.com/he-bcs/Books?action=resource&itemId=047...

“ n the mid-1980s, Microsoft and IBM cooperated to develop the OS/2 operating system, which was written in assembly language for single-processor Intel 80286 systems. In 1988, Microsoft decided to make a fresh start and to develop a “new technology” (or NT) portable operating system that supported both the OS/2 and POSIX application programming interfaces (APIs). In October 1988, Dave Cutler, the architect of the DEC VAX/VMS operating system, was hired and given the charter of building this new operating system.”

Re:Why is the DOS path character "\"? (2005) by thesuitonym on Friday February 26, 2021 @02:42PM (#26278973)
Is the fact that it's a very stable and robust kernel that evolved over different means, with different priorities and expectations not enough?

The kernel itself is very interesting, regardless of what happened in the Linux world. If all you ever look at is Linux, you get stuck in Linux ideas of how things should, or even can, be done.

Re:Why is the DOS path character "\"? (2005) by dmitrygr on Friday February 26, 2021 @05:19AM (#26273267)
Proper support for paged kernel memory? Async-by-default I/O? Must better power management (compare win vs linux battery life on same hardware).
Re:Why is the DOS path character "\"? (2005) by pjc50 on Friday February 26, 2021 @06:24AM (#26273663)
The latter is definitely because the hardware manufacturers QA with it.
Re:Why is the DOS path character "\"? (2005) by cheph on Friday February 26, 2021 @09:06AM (#26274844)
> Async-by-default I/O?

What? Can you elaborate? I mean if you want non blocking IO from an fd in Linux, you can just do that. Not sure what defaults have to do with anything. Your code will still have to be written appropriately.

Re:Why is the DOS path character "\"? (2005) by dmitrygr on Friday February 26, 2021 @01:43PM (#26278192)
Default in linux is read()/write() and be blocked. Doing async is a lot more work and until relatively (to NT timelines) recently quite limited (select).

On NT the standard way is async, and doing things in the block-and-wait way is abnormal and unusual.

Defaults matter. Because that's what most people will do.

Re:Why is the DOS path character "\"? (2005) by cheph on Thursday March 04, 2021 @09:16AM (#26342724)
Linux use read(2)/write(2) for both blocking and non-blocking. Still don't understand what you mean by how NT does it. Either your code is written to accomodate Async IO or not.
Re:Why is the DOS path character "\"? (2005) by marcodiego on Friday February 26, 2021 @08:03AM (#26274334)
Bad power management is really manufacturers fault. See android phones or chromebooks that can last days without recharging.
Re:Why is the DOS path character "\"? (2005) by pram on Friday February 26, 2021 @05:07AM (#26273182)
Isn't that what SFU was?