EDIT: Another alternative would be to be able to slide the main screen halfway to the side thus allowing a second screen next to it for a dual screen setup.
574 karma · joined April 27, 2016
EDIT: Another alternative would be to be able to slide the main screen halfway to the side thus allowing a second screen next to it for a dual screen setup.
The idea of a second screen above the keyboard does not appeal to me. I have a Macbook Pro with a touch bar and in general I dislike it (even though I have written a custom dock for it, which allows me to reclaim some main screen real estate from the macOS Dock). I understand that this new MSFT screen is bigger and potentially more useful, but the problem of having to look down on the second screen above the keyboard would still be there.
(I am aware of macOS Sidecar.)
To clarify this is part of a larger library that includes other memory management machinery, such as autorelease pools, etc.
When I do apps I have my own length-prefixed variant.
My personal variant uses 32-bits for length and 32-bits for refcount, which aligns well on most platforms, including 64-bit ones.
Something like:
struct string_header
{
int32_t refcnt;
int32_t length;
// character content starts here
};
Given a char pointer to get to the header you must do: ((struct string_header *)p)[-1]The beauty of the C string is that it is minimal and straightforward: if you have a pointer to it, you know where it ends. And it works with pretty much any OS out there.
(My personal variant of dynamic strings are refcounted, length prefixed and nul-terminated with the pointer pointing to the traditional C string.)
You are correct.
I asked the same question on their GitHub issues: https://github.com/microsoft/WSL/issues/4022
https://www.gnu.org/licenses/gpl-faq.html#MereAggregation https://www.gnu.org/licenses/gpl-faq.html#AggregateContainer...
I do not know, but I can see arguments on both sides. This is why I would love to hear the opinion of the FSF on this.
I think this comment may have been disingenuous on their part. The reason is that this problem more than likely still exists in WSL2 for the /mnt/c, /mnt/d file systems (i.e. what they used to call "DrvFs" in WSL1).
WSL1 comes with (at least) 2 file systems. "VolFs" which is the file system that they use for the Linux root file system and "DrvFs" which is the file system that they use to access Windows drives (C:, D:, ...).
In WSL1 VolFs was implemented as a layer on top of NTFS, so it comes with all the Windows file system and NTFS baggage. In WSL2 they will replace this file system with a native ext4 formatted partition on a VHD file, thus eliminating the Windows I/O stack (except for READ/WRITE I/O to the VHD file).
My contention is that they could have instead replaced VolFs with a native WSL1 file system that uses a disk partition or VHD as its backend storage, thus eliminating the Windows I/O stack in the same way. They could then have implemented proper Linux file system semantics without any baggage.
> I think they found the boundary of OS research in this case
Unlikely. It would not surprise me if the changes we are seeing are less technical and more political.
Presenting a Linux syscall interface on top of Windows is a hard task. The systems have fundamentally different approaches to many OS functionalities. In general you cannot just 1:1 map syscalls between the two. I am very familiar with the Windows kernel and fairly familiar with the Linux kernel and I am 100% convinced of this.
This is not to minimize the FreeBSD achievement. However I expect that mapping from Linux to FreeBSD and back would be an easier task. I should note here that I only know generalities about the FreeBSD kernel and would be willing to be educated if that is not the case and done in good faith.
WSL1 was pushing the boundaries of OS research: - a method for having multiple syscall interfaces in a mainstream OS - processes in WSL1 were real NT processes (even if lacking some of the NTOS environment) - direct integration with the rest of the OS without an awkward VM separation layer.
In comparison WSL2 is basically an optimized VM with some fancy guest additions. Color me underwhelmed.
I understand the argument that WSL2 is faster than WSL1 in file system operations. I expect this will only be true for their root file system ("VolFs") and that performance will remain same or suffer for Windows drives ("DrvFs"). I am certain that they could fix "VolFs" performance by moving the file system of NTFS and into a raw disk partition or VHD. (Note: I write file systems both in and out of kernel.)
Finally WSL2 will be distributed with Windows which raises some licensing questions (IANAL) if not in the letter of the GPL license at least in spirit. I write GPL'ed software myself and I would be somewhat miffed if I saw my software used in a similar manner (i.e. "via a VM", but still distributed with non-GPL code).
The included sample, called rawdisk, memory maps a file and uses it as a disk image file. This could presumably be done over SMB or NFS, although I have not tested the performance.
The practical one is that I wanted to be able to store disk data in a cloud storage bucket (i.e. "format" a bucket with NTFS and use it as a disk). For various reasons I did not want to build this as a WinFsp or FUSE file system.
The theoretical one is that I am exploring the possibility of writing a new OS where all/most IO/services/etc. could be implemented either in kernel mode or user mode. Not bolt it onto an existing OS like I have done with WinFsp and WinSpd, but build the OS like this from the ground up.
To finish here are some use cases for WinSpd as food for thought:
- Mounting virtual disks in a format other than VHD.
- Mounting a cloud storage bucket as a disk.
- Serving a read-only disk from an internet location for use by multiple users.
- Tracking disk I/O for backup, snapshotting or other purposes.
I think the main difference is that WinSpd is a general tool for creating disks as user mode processes, whereas ImDisk is a tool for mounting image files only.
It looks like WinSpd is a more generic tool. But I know very little about ImDisk so I may be mis-representing it.
Command queues are supported by default as well, as this is a Storport virtual miniport driver (which supports command queues).
Here is the most updated version of those documents:
I like to think that WinFsp is very stable software. I am working to bring WinSpd to the same levels of stability.
In my case I wanted a simple way to create "SCSI disks" using a user mode process. Since I had already created WinFsp, which has a solid IPC (Inter-Process Communication) protocol, this felt like the best way forward.
They both have their uses but in general I think WinFsp is more useful for most.
I am not familiar with ImDisk.
- P/Invoke. - Recompiling the library in C++/CLI mode.