Page 1 of 3

Can Windows be replaced, and how !?

Posted: Thu Sep 01, 2022 8:06 am
by devc1
Windows did alot to dominate the computer industry, but it still has severe problems such as viruses, relying alot on the hard drive, slow computing and requires high end hardware to work without lagging and so on.

Talking about high end hardware requirements, Windows main problem is using high level languages such as C# for applications, these (dumb) languages can use alot of memory for a small program and since we see about 2000 threads at startup (and we are osdevers), it is not weird to see 60% of your memory is used without opening a single application.

The main problem with security isn't Windows, as a developer I've never experienced a virus from my childhood because I'm knowledgeable about them, however new users will fall for them.

Another very big problem with Windows, is that most its services and drivers run in user mode, I know that IO Can be mapped but what about System Specific routines that slows them down.

Linux is stable, fast but has an embarassing GUI compared to Windows, and can't seem to have good desktop marketing techniques.
The problem is that these kernels still support 32 bit, (Until Windows 11) and I can't see them using SIMD Parallel processing.

My kernel is 500 KB and never uses libraries, Windows NT is 12 MB which is 24 Times bigger. I still have alot to add !

Here is a routine from Windows NT Kernel:

Edit : Windows NT contains alot of SSE and AVX routines (I was wrong), I heard that Linux doesn't ??

Re: Can Windows be replaced, and how !?

Posted: Thu Sep 01, 2022 9:17 am
by nullplan
devc1 wrote:The main problem with security isn't Windows, as a developer I've never experienced a virus from my childhood because I'm knowledgeable about them, however new users will fall for them.
Oh yeah, mister holier-than-thou (or in this case cleverer-than-thou), you will never be affected by a virus, ever. Let me share my first experience with a virus: I got a floppy disk for Christmas, and plugged it into my computer, and eagerly ran the software contained. Unfortunately, the floppy had been infected before I ever got it.

Stuxnet famously propagated itself through a bug in Windows' icon handling. So it was sufficient to view the directory containing Stuxnet in Explorer (or any third-party tool that still renders icons, such as Total Commander). But no, your superior knowledge will surely keep you safe.

And just to be absolutely clear: Yes, that was sarcasm.
devc1 wrote:Another very big problem with Windows, is that most its services and drivers run in user mode, I know that IO Can be mapped but what about System Specific routines that slows them down.
What are you on about? Which of its drivers run in user mode? And why is it a problem to be reducing the kernel mode attack surface?
devc1 wrote:Linux is stable, fast but has an embarassing GUI compared to Windows, and can't seem to have good desktop marketing techniques.
The problem is that these kernels still support 32 bit, (Until Windows 11) and I can't see them using SIMD Parallel processing.
Why is this a problem? What are you talking about? Do you maybe want to unjumble the article before posting it?

Regarding SIMD, kernels have exactly two choices: Don't use SIMD, or use SIMD and save all SIMD registers every time the kernel is entered. Since you pay the cost for save and restore on every entry and exit, but reap the benefits of (marginally) faster runtimes only rarely, I know what choice I make in my kernel. Other people may choose differently.

OK, there is a third choice: Use SIMD only in hand-written routines, and save the SIMD registers before calling those. I doubt the setup overhead makes this worthwhile.
devc1 wrote:Here is a routine from Windows NT Kernel:
I gave up reading that after three instructions, because that's how long it took to jump outside of the code you were showcasing. What is the point of this assembler dump? You don't know how much memory it is using. True, there is no SIMD, but that is likely because the NT people disabled SIMD optimizations for the kernel, for the reason pointed out above.
devc1 wrote:I can call this an optimized routine, and it is done in assembly because it almost uses no RAM.
You can call it a water sheep for all I care, and I doubt it was written in assembler, because Microsoft is a lot of things, but the NT people at least aren't stupid. And what are you talking about with the "almost no RAM"? You see all those memory references? That's RAM usage. And without the structure it is impossible to see if there is an allocation loop going on. Every single call instruction could be going to an allocation routine for all we can see.

Re: Can Windows be replaced, and how !?

Posted: Thu Sep 01, 2022 9:26 am
by AndrewAPrice
Can Windows be replaced, and how !?
I work on a Linux desktop, have a Macbook, my wife has a Macbook, I have an Android phone, my wife has an iPhone.

I do have a Windows PC just for gaming, but it rarely gets turned on because life is busy.

If you want to replace Windows, just replace it. Life goes on and the transition for you is done.

Re: Can Windows be replaced, and how !?

Posted: Thu Sep 01, 2022 9:37 am
by devc1
I don't say that I am holier-dan-doww, I just don't use flash drives and floppys from my friends, and don't get trapped by dumb websites. However before, I was getting virus like every new PC and Mobile user.
Mr Sarcasm, services are run by users right, so users maybe new users and if they download some driver that runs in kernel mode. It may destroy their experience, right ? that's why windows uses User-Mode Drivers. However there still are kernel mode ones.

Windows NT Seems to have AVX Optimization :::)))

But (dumb languages) C# and Python are still destroying this optimization,,,

Code: Select all

   140437905:	c4 c2 7d 00 f6       	vpshufb %ymm14,%ymm0,%ymm6
   14043790a:	c5 fe 6f 00          	vmovdqu (%rax),%ymm0
   14043790e:	48 83 c0 20          	add    $0x20,%rax
   140437912:	48 89 42 18          	mov    %rax,0x18(%rdx)
   140437916:	48 8b 42 20          	mov    0x20(%rdx),%rax
   14043791a:	c4 c2 7d 00 de       	vpshufb %ymm14,%ymm0,%ymm3
   14043791f:	c5 fe 6f 00          	vmovdqu (%rax),%ymm0
   140437923:	c4 42 7d 00 c6       	vpshufb %ymm14,%ymm0,%ymm8
   140437928:	48 83 c0 20          	add    $0x20,%rax
   14043792c:	48 89 42 20          	mov    %rax,0x20(%rdx)
   140437930:	48 8b 42 28          	mov    0x28(%rdx),%rax
   140437934:	c5 fe 6f 00          	vmovdqu (%rax),%ymm0
   140437938:	c4 c2 7d 00 d6       	vpshufb %ymm14,%ymm0,%ymm2
   14043793d:	48 83 c0 20          	add    $0x20,%rax
   140437941:	48 89 42 28          	mov    %rax,0x28(%rdx)
   140437945:	48 8b 42 30          	mov    0x30(%rdx),%rax
   140437949:	c5 3d 6a ca          	vpunpckhdq %ymm2,%ymm8,%ymm9
   14043794d:	c5 fe 6f 00          	vmovdqu (%rax),%ymm0
   140437951:	c4 c2 7d 00 ee       	vpshufb %ymm14,%ymm0,%ymm5
   140437956:	48 83 c0 20          	add    $0x20,%rax
   14043795a:	48 89 42 30          	mov    %rax,0x30(%rdx)
   14043795e:	48 8b 42 38          	mov    0x38(%rdx),%rax
   140437962:	c5 fe 6f 00          	vmovdqu (%rax),%ymm0
   140437966:	c4 c2 7d 00 ce       	vpshufb %ymm14,%ymm0,%ymm1
   14043796b:	c5 cd 62 c3          	vpunpckldq %ymm3,%ymm6,%ymm0
   14043796f:	c5 5d 6d d0          	vpunpckhqdq %ymm0,%ymm4,%ymm10
   140437973:	c5 5d 6c d8          	vpunpcklqdq %ymm0,%ymm4,%ymm11
   140437977:	c5 cd 6a db          	vpunpckhdq %ymm3,%ymm6,%ymm3
   14043797b:	c5 bd 62 f2          	vpunpckldq %ymm2,%ymm8,%ymm6
   14043797f:	c5 d5 62 d1          	vpunpckldq %ymm1,%ymm5,%ymm2
   140437983:	c5 d5 6a c9          	vpunpckhdq %ymm1,%ymm5,%ymm1
   140437987:	c5 45 6c c3          	vpunpcklqdq %ymm3,%ymm7,%ymm8
   14043798b:	c5 cd 6c ea          	vpunpcklqdq %ymm2,%ymm6,%ymm5
   14043798f:	c5 cd 6d e2          	vpunpckhqdq %ymm2,%ymm6,%ymm4
   140437993:	c5 b5 6d d1          	vpunpckhqdq %ymm1,%ymm9,%ymm2
   140437997:	c5 c5 6d fb          	vpunpckhqdq %ymm3,%ymm7,%ymm7
   14043799b:	c5 b5 6c d9          	vpunpcklqdq %ymm1,%ymm9,%ymm3
   14043799f:	48 83 c0 20          	add    $0x20,%rax
   1404379a3:	48 89 42 38          	mov    %rax,0x38(%rdx)
   1404379a7:	c4 e3 25 46 c5 20    	vperm2i128 $0x20,%ymm5,%ymm11,%ymm0
   1404379ad:	c4 c1 7e 7f 40 c0    	vmovdqu %ymm0,-0x40(%r8)
   1404379b3:	c4 e3 2d 46 cc 20    	vperm2i128 $0x20,%ymm4,%ymm10,%ymm1
   1404379b9:	c4 c1 7e 7f 48 e0    	vmovdqu %ymm1,-0x20(%r8)
   1404379bf:	c4 e3 3d 46 c3 20    	vperm2i128 $0x20,%ymm3,%ymm8,%ymm0
   1404379c5:	c4 c1 7e 7f 00       	vmovdqu %ymm0,(%r8)
   1404379ca:	4d 8d 80 00 01 00 00 	lea    0x100(%r8),%r8
   1404379d1:	c4 e3 45 46 ca 20    	vperm2i128 $0x20,%ymm2,%ymm7,%ymm1
   1404379d7:	c4 c1 7e 7f 88 20 ff 	vmovdqu %ymm1,-0xe0(%r8)
   1404379de:	ff ff 
   1404379e0:	c4 e3 25 46 c5 31    	vperm2i128 $0x31,%ymm5,%ymm11,%ymm0
   1404379e6:	c4 e3 2d 46 cc 31    	vperm2i128 $0x31,%ymm4,%ymm10,%ymm1
   1404379ec:	c4 c1 7e 7f 80 40 ff 	vmovdqu %ymm0,-0xc0(%r8)
   1404379f3:	ff ff 
   1404379f5:	c4 c1 7e 7f 88 60 ff 	vmovdqu %ymm1,-0xa0(%r8)
   1404379fc:	ff ff 
   1404379fe:	c4 e3 3d 46 c3 31    	vperm2i128 $0x31,%ymm3,%ymm8,%ymm0
   140437a04:	c4 e3 45 46 ca 31    	vperm2i128 $0x31,%ymm2,%ymm7,%ymm1
   140437a0a:	c4 c1 7e 7f 40 80    	vmovdqu %ymm0,-0x80(%r8)
   140437a10:	c4 c1 7e 7f 48 a0    	vmovdqu %ymm1,-0x60(%r8)
   140437a16:	48 83 eb 01          	sub    $0x1,%rbx
   140437a1a:	0f 85 a1 fe ff ff    	jne    0x1404378c1
   140437a20:	c4 41 7e 6f 81 40 03 	vmovdqu 0x340(%r9),%ymm8
   140437a27:	00 00 
   140437a29:	c4 41 7e 6f 89 60 03 	vmovdqu 0x360(%r9),%ymm9
   140437a30:	00 00 
   140437a32:	c4 41 7e 6f 91 80 01 	vmovdqu 0x180(%r9),%ymm10
   140437a39:	00 00 
   140437a3b:	c5 7e 7f 4d 20       	vmovdqu %ymm9,0x20(%rbp)
   140437a40:	c5 7e 7f 55 00       	vmovdqu %ymm10,0x0(%rbp)
   140437a45:	c4 41 7e 6f d8       	vmovdqu %ymm8,%ymm11
   140437a4a:	c4 41 7e 6f e0       	vmovdqu %ymm8,%ymm12
   140437a4f:	c4 41 7e 6f e8       	vmovdqu %ymm8,%ymm13
   140437a54:	c4 41 7e 6f f8       	vmovdqu %ymm8,%ymm15
   140437a59:	c4 41 7e 6f f1       	vmovdqu %ymm9,%ymm14
   140437a5e:	49 8d 81 a0 02 00 00 	lea    0x2a0(%r9),%rax
   140437a65:	44 8d 43 18          	lea    0x18(%rbx),%r8d
   140437a69:	c5 fe 6f b8 00 ff ff 	vmovdqu -0x100(%rax),%ymm7
   140437a70:	ff 
   140437a71:	c4 c1 55 72 d0 0a    	vpsrld $0xa,%ymm8,%ymm5
   140437a77:	c5 fd 72 f7 19       	vpslld $0x19,%ymm7,%ymm0
   140437a7c:	c5 dd 72 d7 03       	vpsrld $0x3,%ymm7,%ymm4
   140437a81:	c5 f5 72 d7 07       	vpsrld $0x7,%ymm7,%ymm1
   140437a86:	c5 fd ef c9          	vpxor  %ymm1,%ymm0,%ymm1
   140437a8a:	c4 c1 7d 72 f5 0f    	vpslld $0xf,%ymm13,%ymm0
   140437a90:	c5 ed 72 f7 0e       	vpslld $0xe,%ymm7,%ymm2
   140437a95:	c5 f5 ef d2          	vpxor  %ymm2,%ymm1,%ymm2
   140437a99:	c4 c1 75 72 d7 11    	vpsrld $0x11,%ymm15,%ymm1
   140437a9f:	c5 fd ef c9          	vpxor  %ymm1,%ymm0,%ymm1
   140437aa3:	c5 e5 72 d7 12       	vpsrld $0x12,%ymm7,%ymm3
   140437aa8:	c5 ed ef db          	vpxor  %ymm3,%ymm2,%ymm3
   140437aac:	c5 e5 ef f4          	vpxor  %ymm4,%ymm3,%ymm6
   140437ab0:	c4 c1 5d 72 d3 13    	vpsrld $0x13,%ymm11,%ymm4
   140437ab6:	c4 c1 6d 72 f4 0d    	vpslld $0xd,%ymm12,%ymm2
   140437abc:	c5 f5 ef d2          	vpxor  %ymm2,%ymm1,%ymm2
   140437ac0:	c5 ed ef dc          	vpxor  %ymm4,%ymm2,%ymm3
   140437ac4:	c5 e5 ef c5          	vpxor  %ymm5,%ymm3,%ymm0
   140437ac8:	c4 c1 7d fe ca       	vpaddd %ymm10,%ymm0,%ymm1
   140437acd:	c5 f5 fe 10          	vpaddd (%rax),%ymm1,%ymm2
   140437ad1:	c5 7e 6f 90 20 ff ff 	vmovdqu -0xe0(%rax),%ymm10
   140437ad8:	ff 

Re: Can Windows be replaced, and how !?

Posted: Thu Sep 01, 2022 9:56 am
by Schol-R-LEA
Assuming that this is a technical question, rather than a marketing and management one, is a mistake. Windows' success has little to do with its technical merits, something which can be said about technology in general really.

Note that, despite its only somewhat deserved reputation for technical superiority, Linux has mostly been sold on itself not being either Windows or MacOS, and on the simple fact that it is free and open source. The overwhelming majority of Linux installations are in set-top units, where it was selected as the kernel because it was free and easily modifiable. On the desktop, for the most part only programmers and dedicated Linux advocates use it regularly - not because it is bad as a desktop, but because most home and business users buy pre-made systems with Windows pre-installed, and few see the point in going to an extra effort for a different OS.

Replacing Windows in the market? Not in the current circumstances, no. The installed base is what matters, not the technical specs, and even in those places where the technical capabilities do matter, raw performance is almost never the key factor. Windows is big because Windows has to support a plethora of hardware configurations and user needs, not because it is badly written. Replacing Windows means retraining, and that is seen (rightly or wrongly) as being far more expensive to most companies than the inefficiencies and vulnerabilities of Windows could ever be.

As for memory usage, very little of that is code - most of the memory footprint of modern programs is in the data, not the executable size. A modern web browser still needs memory space for all junk that most web pages load these days. A game still needs the megabytes of graphics and audio data. A spreadsheet needs to be able to traverse over hundreds if not thousands of rows and columns. And so forth.

It has been said before, and I will say it again: there is no such thing as commercial operating system development in the modern market. Windows succeeds because of Microsoft Office and myriad sweetheart deals with hardware vendors. MacOS succeeds because it is tied to Apple hardware and the corporate following. Linux succeeds because it is free and open-source, and because some people don't want Windows or MacOS. None of them would survive as stand-alone for-profit products.

Re: Can Windows be replaced, and how !?

Posted: Thu Sep 01, 2022 10:12 am
by devc1
Yes, Microsoft Windows has made a very solid almost undestructible base when talking about computer Operating Systems, you can find it on almost every computer, it has a wide compatibility among PCs and features alot of technology. However, having the least performance among the 3 most famous OS's (Linux, Windows, MacOS) will not impact its base.

I will add a question, why does windows use alot of RAM even if you are not opening any program. I always think of this as a trick to make you buy more RAM ?
Why Windows is faster with an SSD, on an HDD Windows read/write speed are far slower than what the manufacturer says. Is this a trick to make you buy a new SSD ?

Re: Can Windows be replaced, and how !?

Posted: Thu Sep 01, 2022 11:40 am
by Ethin
devc1 wrote:I don't say that I am holier-dan-doww, I just don't use flash drives and floppys from my friends, and don't get trapped by dumb websites. However before, I was getting virus like every new PC and Mobile user.
Uh... You clearly have very little cybersecurity education. "Dumb websites" and "flash drives"/"floppy disks" are only three vectors of infection that a malicious person can use to attack you. There are so many different ways someone can get a virus into any system, no matter how secure it is, that its not even funny. You run a bunch of applications on your computer that are potentially from untrusted sources. Any of those applications could have memory-based vulnerabilities (read/write out of bounds, null pointer dereference, ...). All of those can be exploited, remotely, by an attacker. There are 0-click vulnerabilities that allow attackers to break into your iPhone by just sending you a text message -- and you don't even have to unlock your phone or do anything else for it to happen either!
devc1 wrote:Mr Sarcasm, services are run by users right, so users maybe new users and if they download some driver that runs in kernel mode. It may destroy their experience, right ? that's why windows uses User-Mode Drivers. However there still are kernel mode ones.
Windows services are not drivers. They cannot interact with hardware without calling into the kernel first or loading a kernel-mode driver to expose that functionality for them. A service is a special type of user-mode program with, at most, system account privileges. They can do a bunch of damage, sure, but they aren't drivers.

Re: Can Windows be replaced, and how !?

Posted: Thu Sep 01, 2022 12:01 pm
by devc1
I appreciate your reply :)

There are still many questions that I think (and hope) we will expand this topic for.

Devc1,

Re: Can Windows be replaced, and how !?

Posted: Thu Sep 01, 2022 12:42 pm
by iansjack
For goodness sake! What is the point of these Windows-bashing threads? If you don’t like it, don’t use it. Linux windowing environments are every bit as good as Windows, as is Mac OS.

Assembly language is not efficient. It’s slower than high-level code, more prone to bugs, harder to maintain, and - worst of all - irrevocably tied in to a particular processor family. Disk and RAM size are no longer a problem.

Re: Can Windows be replaced, and how !?

Posted: Thu Sep 01, 2022 8:02 pm
by devc1
I admit that I cannot use Linux in my PC, Windows suits me however we're just discussing the chances and how it may be replaced my another OS in the future. Something like what happened to nokia : )

Devc1,

Re: Can Windows be replaced, and how !?

Posted: Thu Sep 01, 2022 9:09 pm
by nullplan
devc1 wrote:however we're just discussing the chances and how it may be replaced my another OS in the future.
Then why was that not in the OP? Because that one only contained a jumbled mess of "complaints" in the loosest sense of the word, and did not manage to even form a coherent question.
devc1 wrote:Something like what happened to nokia
What happened with Nokia was that they could not be beaten at their own game, so someone else (with massive amounts of money, I might add) changed the game. Nokia had an unassailable position in the feature phone market and did not take the smartphone seriously until it steamrolled them.

I honestly cannot see anything like that happening with Microsoft. The death of the desktop PC has often been foretold over the last decade, yet it has failed to come to pass. There's just too much inertia; too many businesses depend on desktop PCs to do their jobs. Even if all private users switched to tablets tomorrow, the desktop PC would continue on for a long time.

Re: Can Windows be replaced, and how !?

Posted: Thu Sep 01, 2022 9:32 pm
by Octocontrabass
devc1 wrote:on an HDD Windows read/write speed are far slower than what the manufacturer says
What do you mean? Didn't you yourself post a benchmark of an HDD in Windows that showed almost exactly the manufacturer's specified read/write speed?

Re: Can Windows be replaced, and how !?

Posted: Thu Sep 01, 2022 11:44 pm
by eekee
devc1 wrote:Windows did alot to dominate the computer industry, but it still has severe problems such as viruses, relying alot on the hard drive, slow computing and requires high end hardware to work without lagging and so on.
Put a web browser on "modern" Linux and open more than a few tabs, and you'll have all these complaints about Linux too. Using Linux in 2015 -- more than 15 years after Linux's maintainer realised he had to get serious about security -- I found a web advert loading an exploit into my Intel GPU which crippled it until I rebooted. In 2017, I found the same under FreeBSD. For roughly 20 years I had avoided Windows like the plague, but after that, I bought a Windows PC because "why not?" I'm typing this on a Windows laptop right now, and I'm not sure I have any remaining Linux installations except for a VM with an ancient version I keep for reasons of nostalgia and self-torture. :lol:

A friend once told me about his misspent youth: in the 90s, he hacked into Linux servers with no understanding at all, just "modules" from criminal websites. This was before Linux got serious about security, but looking back, I don't think Linux has ever been very much more secure than Windows. It's just that criminals didn't think desktop Linux was worth their time.

Besides security, Linux desktops are massively dependent on the hard drive, as I'm reminded every time I use Knoppix. If you try to do without them, you waste your own time and energy with a maze of twisty little config languages, none quite alike, and there's ALWAYS something which takes 10 times more work than necessary.

Re: Can Windows be replaced, and how !?

Posted: Fri Sep 02, 2022 2:25 am
by devc1
Octocontrabass wrote: What do you mean? Didn't you yourself post a benchmark of an HDD in Windows that showed almost exactly the manufacturer's specified read/write speed?
Where ? I said that my driver did 500 MB in 1100ms, The manufacturer says it is 300 MB/S and Windows Benchmark says it is 98 MB/S

Re: Can Windows be replaced, and how !?

Posted: Fri Sep 02, 2022 2:37 am
by devc1
Yo, everyone talks about the cyber security problems, and I am not an expert in this. My uncles once talked to me about these problems also, A virus in Windows 95 IIRC
called "folder" "redlof(ve)", how cyber-criminals used to get into your PC with just a picture or when plugging your floppy. PC's with 10 MB RAM were worth 3000 Dollars or whatever. My brain still can't figure out the ways that they do that. So let's say I completed my OS, someone will create a True Type font and enter the Kernel Mode and blablablaa. How can this happen ? How they do that ? I also plan to require TPM to encrypt all system files.