2/n Windows EXE files consist of two parts: a DOS program that prints "This program cannot be run in DOS mode", followed by a header that Windows understands.
-
-
Prikaži ovu nit
-
3/n In a way, all EXEs are DOS programs - they're just not very useful DOS programs. One day I found this project (that deserves way more GitHub stars than it has):https://github.com/Baron-von-Riedesel/Dos64-stub …
Prikaži ovu nit -
4/n Dos64-stub is a small program that replaces the useless "Cannot run in DOS" with code that loads the Windows-specific portion of the EXE and teleports the process into 21. century. By teleporting I mean setting up paging and switching the CPU into 64-bit ("long") mode
Prikaži ovu nit -
5/n I started with my C# 8 kB self-contained Windows snake game:https://twitter.com/MStrehovsky/status/1213034748848807937 …
Prikaži ovu nit -
6/n Of course DOS doesn't have Windows APIs, so I had to rewrite how the game talks to the world. This is Environment.TickCount on DOS:pic.twitter.com/dewh4CwHXA
Prikaži ovu nit -
7/n Once we have the number of ticks, we can do Thread.Sleep:pic.twitter.com/ZZnUxF2z8G
Prikaži ovu nit -
-
9/n From there, it's easy: C# compiler -> CoreRT AOT compiler -> Linker. We tell the linker to use Dos64-stub instead of generating the useless "Cannot be run in DOS" program.pic.twitter.com/3XK6Yh4PM1
Prikaži ovu nit -
10/n Here's the pull request with all of it:https://github.com/MichalStrehovsky/SeeSharpSnake/pull/5 …
Prikaži ovu nit
Kraj razgovora
Novi razgovor -
-
-
I'm having so much fun reading about these things. Keep up the weird work!
Hvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.