Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the board
Thread view  Mix view  Order
4D5A9000

12.02.2021, 10:41
 

Compiling Windows on DOS? (Developers)

As everyone knows, Windows 2003's source codes have been leaked. And I downloaded them. By using some tools, I found that its compiler doesn't import ntdll.dll. So, it's possible to compile Windows 2003 on Win9x, even on DOS by using HX. Then I started to try. But I encountered a problem. Many scripts for compilation use .cmd file extension and command.com doesn't recognize it as a batch file. Changing then to .bat extension one by one would be a disaster. (And you also have to replace .cmd in the scripts to .bat) So, my question is: How to let command.com run a .cmd file?

rr

Homepage E-mail

Berlin, Germany,
12.02.2021, 12:14

@ 4D5A9000

Compiling Windows on DOS?

> As everyone knows, Windows 2003's source codes have been leaked. And I
> downloaded them. By using some tools, I found that its compiler doesn't

Be aware: We don't support any illegal stuff here.

> import ntdll.dll. So, it's possible to compile Windows 2003 on Win9x, even
> on DOS by using HX. Then I started to try. But I encountered a problem.
> Many scripts for compilation use .cmd file extension and command.com
> doesn't recognize it as a batch file. Changing then to .bat extension one
> by one would be a disaster. (And you also have to replace .cmd in the
> scripts to .bat) So, my question is: How to let command.com run a .cmd
> file?

This is a valid question. So to give you an idea: Windows NT (or higher) .cmd files use a different/extended syntax. Just renaming everything to .cmd probably won't help very much. You need a new command.com to understand the different syntax or you have to remove/replace the extended syntax.

---
Forum admin

Laaca

Homepage

Czech republic,
12.02.2021, 12:20

@ 4D5A9000

Compiling Windows on DOS?

Is is not certain whether just renaming the .CMD to .BAT will help.
However you can try to recompile FreeCOM and modify it to recognise not .BAT files but .CMD files.
Other, maybe simplier approach is to modify COMMAND.COM in hexadecimal editor and replace all occurencies from BAT to CMD.

If you want to run both - BAT files and CMD files you can hexaedit 4DOS shell because it understands .BAT files and .BTM files.

---
DOS-u-akbar!

mceric

Germany,
12.02.2021, 16:30

@ 4D5A9000

Compiling Windows on DOS?

> As everyone knows, Windows 2003's source codes have been leaked. And I
> downloaded them. By using some tools, I found that its compiler doesn't
> import ntdll.dll. So, it's possible to compile Windows 2003 on Win9x, even
> on DOS by using HX. Then I started to try. But I encountered a problem.
> Many scripts for compilation use .cmd file extension and command.com
> doesn't recognize it as a batch file. Changing then to .bat extension one
> by one would be a disaster. (And you also have to replace .cmd in the
> scripts to .bat) So, my question is: How to let command.com run a .cmd
> file?

Why on earth would you want to recompile Windows 2003? And why on earth on anything else than the original compiler on the original operating system?

Even if you COULD do it, it might take weeks of CPU time and terabytes of disk space to compile an entire operating system.

Apart from that, it is obviously illegal to roll your own Windows 2003. Sources for that sort of software are only available under non disclosure agreements for security sensitive customers who want to review them.

---
FreeDOS / DOSEMU2 / ...

glennmcc

Homepage E-mail

North Jackson, Ohio (USA),
12.02.2021, 16:46

@ mceric

Compiling Windows on DOS?

> > As everyone knows, Windows 2003's source codes have been leaked. And I
> > downloaded them. By using some tools, I found that its compiler doesn't
> > import ntdll.dll. So, it's possible to compile Windows 2003 on Win9x,
> even
> > on DOS by using HX. Then I started to try. But I encountered a problem.
> > Many scripts for compilation use .cmd file extension and command.com
> > doesn't recognize it as a batch file. Changing then to .bat extension
> one
> > by one would be a disaster. (And you also have to replace .cmd in the
> > scripts to .bat) So, my question is: How to let command.com run a .cmd
> > file?
>
> Why on earth would you want to recompile Windows 2003? And why on earth on
> anything else than the original compiler on the original operating system?
>
> Even if you COULD do it, it might take weeks of CPU time and terabytes of
> disk space to compile an entire operating system.
>
> Apart from that, it is obviously illegal to roll your own Windows 2003.
> Sources for that sort of software are only available under non disclosure
> agreements for security sensitive customers who want to review them.



The answer to the "why?" is @ about 2min of this Big Bang Theory clip. ;-)

https://youtu.be/onZ4KMM94yI?t=109

---
--
http://glennmcc.org/

RayeR

Homepage

CZ,
12.02.2021, 19:04

@ mceric

Compiling Windows on DOS?

> Why on earth would you want to recompile Windows 2003?

Because some people still (want/need/like)use older Windows for whatever reason and they want to do some specific modifications to improve/bugfix it. One example is ACPI.SYS driver has problem running on newer MBs with new ACPI (no legal way to run old Win on such systems) so some people modified it to make it working - by binary hack and later by recompiling from sources, so God bless the leakers :)

> And why on earth on anything else than the original compiler on the original operating system?

I see no point here too. The windows NT build environment is not just CL compiler but a bunch of tools that have to be ported. Well if one don't want to compile it under Windows he may try ReactOS or Wine but not DOS. It would take extreme amount of time. On Windows I had compile time of whole stuff ~6 hours and I belive it would be 10x more under DOS...

> Apart from that, it is obviously illegal to roll your own Windows 2003.

Yeaah :-D

---
DOS gives me freedom to unlimited HW access.

tom

Homepage

Germany (West),
12.02.2021, 21:28

@ 4D5A9000

Compiling Windows on DOS?

> As everyone knows, Windows 2003's source codes have been leaked. And I
> downloaded them. By using some tools, I found that its compiler doesn't
> import ntdll.dll. So, it's possible to compile Windows 2003 on Win9x, even
> on DOS by using HX. Then I started to try. But I encountered a problem.
> Many scripts for compilation use .cmd file extension and command.com
> doesn't recognize it as a batch file. Changing then to .bat extension one
> by one would be a disaster. (And you also have to replace .cmd in the
> scripts to .bat) So, my question is: How to let command.com run a .cmd
> file?

if you are not able to change all references of .cmd to .bat in all *.cmd files below c:\win2003\src the task is WAY above your problem-solving skills anyway.

try something else to kill your spare time.

Zyzzle

13.02.2021, 02:23

@ RayeR

Compiling Windows on DOS?

> > Why on earth would you want to recompile Windows 2003?
>
> Because some people still (want/need/like)use older Windows for whatever
> reason and they want to do some specific modifications to improve/bugfix
> it. One example is ACPI.SYS driver has problem running on newer MBs with
> new ACPI (no legal way to run old Win on such systems) so some people
> modified it to make it working - by binary hack and later by recompiling
> from sources, so God bless the leakers :)

That is *exactly* the point! To fix Microsoft's bugs, short-sightedness, etc, to *improve* that longevity and usability of these so-called "obsolete" operating systems, extending to the range of modern systems.

I wonder if the same hacks and / or recompilings could make Windows XP installable and usable "out-of-the-box" on new systems (well, 2015 on up). I know the ACPI.sys bugs and lacks of AHCI support for XP always results in a 0x7d or 0x7f error on installation on every post- ~2008 system I've tried to install it on. The beauty of XP is that it takes > 2GB of disk space, and would boot in about 3 seconds flat on modern SSD systems. And you'd still have a real DOS subsystem and compatibility with older 32-bit software!

Japheth

Homepage

Germany (South),
13.02.2021, 02:46

@ 4D5A9000

Compiling Windows on DOS?

> How to let command.com run a .cmd file?

I don't know, but I had a somewhat similiar problem with jwasm's regression tests. It was solved by letting run WinXP's cmd.exe under HX. This program runs stable, although one or two messages emitted by cmd.exe are just displayed as "numbers" ( my guess is that's because HX's emulation of the Win32 function FormatMessage() isn't fully mature yet ).

Don't be too easily impressed by the many troll remarks in this thread :-D . A large compile job in DOS might be a bit slower than in linux/windows, but with a RAM disk and a good disk cache ( MS smartdrv is still quite ok ), the speed is acceptable.

---
MS-DOS forever!

RayeR

Homepage

CZ,
13.02.2021, 05:22

@ Zyzzle

Compiling Windows on DOS?

E.g. here you have an XP cookbook for 2021
http://www.tenforums.com/general-support/172922-windows-xp-2021-system-build-modern-pc.html
(I persnonally didn't installed XP on nothing newer than Haswell where I had no issues)

---
DOS gives me freedom to unlimited HW access.

RayeR

Homepage

CZ,
13.02.2021, 05:32

@ Japheth

Compiling Windows on DOS?

Did you enable RdiskSX to handle 40GB+ RAM needed for huge RAM disk to fit all sources and compliled obj+bins? Hope he has enuf RAM, 64GB should be enuf for everyone ;)

---
DOS gives me freedom to unlimited HW access.

mceric

Germany,
13.02.2021, 14:50

@ Zyzzle

Compiling Windows on DOS?

> > > Why on earth would you want to recompile Windows 2003?
> >
> > Because some people still (want/need/like)use older Windows for whatever
> > reason and they want to do some specific modifications to improve/bugfix
> > it. One example is ACPI.SYS driver has problem...

Recompiling a single driver should be SLIGHTLY easier than an entire multi gigabyte operating system, I would say. Also, if you already have Windows and just want to improve it, you can obviously compile the updated driver with your Windows-based compilers running on Windows itself. Things may get A LOT easier then. And you need to steal less sourcecode to only fix ACPI.SYS :-P

---
FreeDOS / DOSEMU2 / ...

rr

Homepage E-mail

Berlin, Germany,
13.02.2021, 15:07

@ Zyzzle

Compiling Windows on DOS?

> > > Why on earth would you want to recompile Windows 2003?
> >
> > Because some people still (want/need/like)use older Windows for whatever
> > reason and they want to do some specific modifications to improve/bugfix
> > it. One example is ACPI.SYS driver has problem running on newer MBs with
> > new ACPI (no legal way to run old Win on such systems) so some people
> > modified it to make it working - by binary hack and later by recompiling
> > from sources, so God bless the leakers :)
>
> That is *exactly* the point! To fix Microsoft's bugs, short-sightedness,
> etc, to *improve* that longevity and usability of these so-called
> "obsolete" operating systems, extending to the range of modern systems.

Recompiling and fixing a leaked source code, doesn't make it "more legal", although your goals are noble.
But I guess, you know that ...

---
Forum admin

Japheth

Homepage

Germany (South),
13.02.2021, 17:38

@ RayeR

Compiling Windows on DOS?

> Did you enable RdiskSX to handle 40GB+ RAM needed for huge RAM disk ...

Not yet. Perhaps using SHSURDRV would be better to modify ... I recall ( vaguely ) that it's able to map a huge (8 GB?) DVD image, using multiple XMS handles. But of course for a RAM disk one would have to make it support FAT32.

---
MS-DOS forever!

tkchia

Homepage

13.02.2021, 19:09
(edited by tkchia, 14.02.2021, 13:01)

@ glennmcc

Compiling Windows on DOS?

Hello glennmcc,

> > Why on earth would you want to recompile Windows 2003? And why on earth
> on
> > anything else than the original compiler on the original operating
> system?

> The answer to the "why?" is @ about 2min of this Big Bang Theory clip. ;-)
> https://youtu.be/onZ4KMM94yI?t=109

Well, the "because you can" reasoning kind of falls flat, if one can't do the thing (yet), no?

I prefer to reserve the phrase for an occasion where someone actually accomplishes what he they set out to do. :-D

"Let us keep our minds open, by all means ... But don’t keep your minds so open that your brains fall out!"

---
https://gitlab.com/tkchia · https://codeberg.org/tkchia · 😴 "MOV AX,0D500H+CMOS_REG_D+NMI"

ecm

Homepage E-mail

Düsseldorf, Germany,
14.02.2021, 12:44

@ tkchia

Compiling Windows on DOS?

> Well, the "because you can" reasoning kind of falls flat, if one can't do
> the thing (yet), no?
>
> I prefer to reserve the phrase for an occasion where someone actually
> accomplishes what he set out to do. :-D

Or she. Or they!

---
l

tkchia

Homepage

14.02.2021, 13:01

@ ecm

Compiling Windows on DOS?

Hello ecm,

> Or she. Or they!

True, that. Thanks!

---
https://gitlab.com/tkchia · https://codeberg.org/tkchia · 😴 "MOV AX,0D500H+CMOS_REG_D+NMI"

RayeR

Homepage

CZ,
14.02.2021, 21:44

@ mceric

Compiling Windows on DOS?

> Recompiling a single driver should be SLIGHTLY easier than an entire multi
> gigabyte operating system...

That was just one of examples. Even a single driver can have huge depencies in sources, I did't try to isolate it. But there may be further attmpts like various kernel/user API extensions etc. so it make sense to be able to rebuild complete Windows. Unfortunatelly the last leaked sources are not complete, some key sources are missing.
I didn't prefer compiling under DOS or other systems than Windows, that I already wrote. Of course I know it's not legal but MS didn't give any other chance (newer legal Windows don't offer the same level of functionality/compatability). I always sympathized with HW/FW/SW hackers who put their own effort to break some stupid/intentional limits and freely opened it to public than huge corporations who created it, sorry I'm not going to change my attitude. I'm not leading anybody to anything, just answering...

---
DOS gives me freedom to unlimited HW access.

tom

Homepage

Germany (West),
15.02.2021, 11:57

@ RayeR

Compiling Windows on DOS?

> > Recompiling a single driver should be SLIGHTLY easier than an entire
> multi
> > gigabyte operating system...
>
> That was just one of examples. Even a single driver can have huge depencies
> in sources, I did't try to isolate it.

nope. usually, drivers are exclusively dependent on themselves, plus some well-defined binary interfaces, that are documented in the DDKs.

people (including me) have developed windows drivers for the last 25 years without ever seeing a single line of windows source code.

there is nothing preventing you from enhancing XP by adding your own driver.

and there is even a very good chance that it will work on Windows 10, too (ignoring 32 bit vs. 64).

in this respect Windows is similar to DOS: 25-year-old stuff still works. without ever recompiling anything:-D

Back to the board
Thread view  Mix view  Order
22049 Postings in 2034 Threads, 396 registered users, 178 users online (0 registered, 178 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum