Windows CE OS GUI (Shell) Is Possible

Discussion in 'Sega Dreamcast Development and Research' started by TerdFerguson, Jan 8, 2017.

  1. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    I was poking around with Windows CE stuff. I always thought in order to load and display the full Windows CE desktop enviroment, one would need to create a new BSP for WCE Platform Builder and compile it for SH4

    Turns out, the Desktop Enviroment is just a "Shell" that runs on top of the WCE kernel. Which we already have from the WCE Dreamcast SDK
    https://msdn.microsoft.com/en-us/library/aa452726.aspx
    https://msdn.microsoft.com/en-us/library/aa453936.aspx

    There is source code for a sample Shell in Windows CE 2.11 Platform Builder (Latest Dreamcast version is 2.12). I had to comment a bunch of stuff out for battery and touch screen, and gather a few missing header files to compile it. Then launched it with "Autorun". Here is the WinDBG output
    shell.png
    So it does attempt to load the Shell, but launching it this way it halts at "Sega: Produced or Licenced by..." screen

    Reading further into the MSDN October 2001 library, it needs to be launched from the registry hive when the kernel is being mapped into ROM
    Launching it this way, without anything in "Autorun", after the kernel is mapped into ROM, the screen goes black attempting to draw the Shell, but because I have no idea how to code and commented out vital stuff, it crashes and the system resets (Normally if you didn't have anything in "Autorun" it would halt at "Sega: Produced by....." and do nothing)

    This I think proves the concept. I'll attach the sample Shell source code with the added WCE DC SDK project files. If someone has the skills and wants to attempt, this wouldn't be too hard at all

    Things to note for someone who attempts:
    • There's a bunch of missing header files, I have all of them but they might not be the right versions, ShellExecuteEx() gives undeclared identifer errors which should be in ShellAPI.h
    • You need Shell32.lib and SHLWAPI.lib or you'll get linker errors, there was one linker error for ShellExecuteEx, which is listed in the library when using dumpbin
    • Instaling Windows CE 2.11 Platform Builder will break the Windows CE Dreamcast SDK, message me for WCE 2.11 include files or install Platform Builder in a virtual machine
    If attaching the source code is illegal even though its public sample code in the SDK, and/or against the rules let me know and I'll remove it

    If this works, a mouse driver would need to be developed. We would be able to use the Dreamcast like a full PC, and with an SD card driver, we'd be able to launch games and homebrew apps making it a more powerful alternative to Dreamshell for Windows CE

    I'd really like to see someone get this up and running, it does work I just can't code
     

    Attached Files:

    BasilDC, wombat, pool7 and 2 others like this.
  2. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Got the unmodified source code to compile for Dreamcast. It's a perfect "port" to Dreamcast

    You can clone the source code and compile "out of the box" with WCE Dreamcast SDK
    https://github.com/FaucetDC/WincastCE

    Crashes on launch though. I'm not skilled enough to figure out why
    Untitled3.png
    If anyone wants to give it a try it's all ready to go
     
    Anthony817 and Xerxes3rd like this.
  3. cyrusmaintea

    cyrusmaintea Rising Member

    Joined:
    Feb 13, 2014
    Messages:
    66
    Likes Received:
    39
    are you using a dev box?
     
  4. system

    system Rising Member

    Joined:
    Aug 31, 2016
    Messages:
    70
    Likes Received:
    12
    The fact that it compiles boots up is amazing, even though it crashes. Nice job
     
  5. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    No, retail via serial. If I had a dev box I could try a lot more

    I actually think the code from this thread is the code for the task manager (taskman.exe). It's the same size, both 24kb and same icon. But you can see the source for the shell is in the GitHub

    I read somewhere on MSDN that non-proprietary versions of WCE require their own custom shell, the typical shell in H/PC's is closed source. But I'm not too sure, I don't know what this sample shell looks like when its run. So this is a starting point for a Dreamcast WCE desktop shell

    It might need to use direct draw, or an alternative way to initialize the framebuffer stuff
    -----
    I also was able to compile an nk.bin and 0winceos.bin using the .bib files and assets (drivers/EXEs/etc) from the Windows CE 2.11 platform builder, when I tried it on a retail dreamcast, it would flicker rapidly at "Sega: Produced by licenced from...." screen which makes me think it gets caught in a loop or at the least is trying to startup

    This can be done if someone with the skill wants to give it a whirl
    Installing Platform Builder will break WCE DC SDK, so its recommended to use a Windows NT 4.0 VM unless you can repair the dev env
     
    MeTaL-VeLCRo and Anthony817 like this.
  6. cyrusmaintea

    cyrusmaintea Rising Member

    Joined:
    Feb 13, 2014
    Messages:
    66
    Likes Received:
    39
    copy of platform builder? or is it the same one in the sdk used to build nk.bin etc
     
    Last edited: Jan 23, 2017
  7. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    tl;dr -- You can get Platform Builder from WinWorld, both can be used to build NK.BIN. If you don't build the NK.BIN with WCE DC SDK, you need to adapt the CONFIG.BIB to reflect the Dreamcast memory addresses, add DC video driver, and build an 0WINCEOS.BIN with GORE2.EXE in the WCE DC SDK
    -------------------------
    You can get WCE 2.11 Platform Builder from WinWorld. It's probably possible to build an nk.bin of the full OS using WCEPB if you have the chops. Then use 'gore2.exe' from the WCE Dreamcast SDK to generate an 0WINCEOS.BIN from the NK.BIN from WCEPB

    You can also add all of the modules from the full WCEPB OS like cmd.exe and taskman.exe, misc DLL components, etc, and build an NK.BIN using the WCE Dreamcast SDK

    If you or someone else takes a look, there is "CONFIG.BIB" in the release directory for both WCE DC and WCE PB, this is the memory map, which dictates the start and end addresses of RAM, how much memory to allocate for the filesystem/framebuffer/etc. When generating the NK.BIN, use CONFIG.BIB from WCE DC SDK or use it as a template and modify the CONFIG.BIB in WCEPB release directory while being sure to assign the correct addresses and allocation size of display/framebuffer/etc

    One other thing is the display driver in the WCE DC SDK is 'ddi.dll'. You'll need to replace the modules in the other .BIB files in the WCEPB release directory to remove the generic display drivers
     
    truemaster1, Anthony817 and pool7 like this.
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page