Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Generic User Avatar

Rebooting on DOS (UEFI) from software


  • Please log in to reply
9 replies to this topic

#1 Labonte18

Labonte18

  •  Avatar image
  • Members
  • 5 posts
  • OFFLINE
  •  
  • Local time:03:54 AM

Posted 12 March 2024 - 02:54 PM

So.. We use an embedded RTOS.. It's basically DOS, more or less. Problem is.. The company that wrote it has shut down, thus ending all support.

This has happened at an inopportune time as we're migrating to UEFI from Legacy BIOS booting.

One problem that we're encountering that has us scratching our heads a bit.. The RTOS program has a reboot function in it.. Basically, it creates a "triple fault" condition to cause a reboot..

This works perfectly fine with a legacy BIOS, but.. Is, at best, intermittent with UEFI systems.

on some of them, we'll hear three beeps, then after about a minute and a half to 2 minutes.. The computer DOES restart. On other systems.. It basically hangs.

This is the code that is in the reboot function from On-Time RTOS..

 

   ////////////////////////////////////////////////////////////////////////////////
   // Intended to cause a triple fault by destroying the IDT and then
   // causing a GPF by destroying the Stack Segment register
   //------------------------------------------------------------------------------
   __asm cli
   // load IDTR
   __asm sub  esp, 8
   __asm mov  word ptr [esp], 0
   __asm mov  dword ptr [esp+2], 0
   __asm lidt fword ptr [esp]
   __asm mov  ax, -1
   __asm mov  ss, ax      ; that should kill him!

 

 

While On Time has ceased operations.. Their website with documentation is still online at http://www.on-time.com/rtos-32-docs/

This is their specific doc on the function.. http://www.on-time.com/rtos-32-docs/rttarget-32/reference-manual/system-functions/rtreboot.htm

and you can see, it's.. Limited in description, just saying

 

RTReboot merely puts the CPU in shutdown mode through a triple fault. This mode is signalled by a special bus cycle. Most motherboards detect this cycle and generate a hardware reset. Thus, the specific reaction to shutdown mode can depend on your motherboard's design.


finding anything at quite this level has been challenging.. We've tried a few things that.. Haven't really panned out.. So.. Throwing it out to all here to see if anyone has any thoughts on this. But more complicated than clicking "Shutdown" but.. It shouldn't be as hard as it's been I wouldn't think.

BC AdBot (Login to Remove)

 


#2 cryptodan

cryptodan

    Bleepin Madman


  •  Avatar image
  • Members
  • 35,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:USA
  • Local time:07:54 AM

Posted 12 March 2024 - 05:50 PM

Is secure boot on?

US Navy Veteran from 2002 to 2006

Masters in Computer and Digital Forensics Expert - Stevenson University Alumni 2015

Arch Desktop - https://termbin.com/epij

Arch Laptop - https://www.termbin.com/dnwk

Ubuntu Server - https://termbin.com/zvra


#3 Labonte18

Labonte18
  • Topic Starter

  •  Avatar image
  • Members
  • 5 posts
  • OFFLINE
  •  
  • Local time:03:54 AM

Posted 12 March 2024 - 06:02 PM

Is secure boot on?

Fair question.. Let me see if I can answer that.

 

So, on the machine where it works, secure boot was disabled (and set to "Custom")

The machine where it doesn't.. It was enabled and set to Standard, I believe it was.. I've disabled it on this machine and tried the reboot command.. No triple beep, but, that's not necessarily telling..

I'll run back up there to eyeball it in a minute to see if it actually rebooted. any of the EFI only machines, the reboot takes about 2 minutes for some reason.. Which.. Is another thing that's confusing.

It would seem no effect. So.. Not sure which way you're wanting that.. On or off.. I presume off.. and I'll keep it that way. It does crash the machine.. Program locks up and you have to hold the power button for 4 seconds to turn the machine off once we issue that reboot.. But the machine never reboots.

I'll have to do a little more testing in the AM to be 100% certain on the results.. but, first indication is.. Disabling Secure Boot had no effect.



#4 cryptodan

cryptodan

    Bleepin Madman


  •  Avatar image
  • Members
  • 35,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:USA
  • Local time:07:54 AM

Posted 12 March 2024 - 06:16 PM

Secure boot off as it could be sensing a malicious action taking place and also set it to custom

US Navy Veteran from 2002 to 2006

Masters in Computer and Digital Forensics Expert - Stevenson University Alumni 2015

Arch Desktop - https://termbin.com/epij

Arch Laptop - https://www.termbin.com/dnwk

Ubuntu Server - https://termbin.com/zvra


#5 JohnC_21

JohnC_21

  •  Avatar image
  • Members
  • 35,027 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:03:54 AM

Posted 13 March 2024 - 08:20 AM

Some computer MBs have a CSM mode where you can boot Legacy one UEFI firmware. I'm not sure if this will help as it seems you can already boot this program in UEFI.

 

https://cpuforever.com/resources/csm-vs-uefi/

 

https://superuser.com/questions/1284392/what-exactly-is-uefi-with-csm-boot-mode



#6 Labonte18

Labonte18
  • Topic Starter

  •  Avatar image
  • Members
  • 5 posts
  • OFFLINE
  •  
  • Local time:03:54 AM

Posted 15 March 2024 - 12:13 PM

Secure boot off as it could be sensing a malicious action taking place and also set it to custom

 

No love on that. I've got both set that way and still seems nothing. We've got half our office out so it's been difficult to get time to work on this. But seems it's the same thing. You hit it and program freezes, but never restarts. I'd say it's more than the program freezing. Probably the machine itself. Comes up after reboot.

 

 

Some computer MBs have a CSM mode where you can boot Legacy one UEFI firmware. I'm not sure if this will help as it seems you can already boot this program in UEFI.

 

https://cpuforever.com/resources/csm-vs-uefi/

 

https://superuser.com/questions/1284392/what-exactly-is-uefi-with-csm-boot-mode

Don't quote me on this, but I believe that's UEFI 2.5 that supported CSM.. And this machine (And, in theory, all new machines) is 3.0.

 

Their previous model machine did support CSM, and that's what we used, and it works perfectly. It's EFI 3.0 machines we're having issues with. Not only this reboot issue, but drive access speeds are slow as well.. That's another project to figure out. I've got to test fully to see if it's flat out drive access that is slow or specific operations that are slow.

A boot on EFI on a CSM enabled machine takes about 30 seconds, which is inline with Legacy boot.. On EFI 3.0 that does not have CSM available.. It takes about 2 minutes.



#7 greg18

greg18

  •  Avatar image
  • Members
  • 1,743 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Los Angeles, CA
  • Local time:02:54 AM

Posted 17 March 2024 - 04:53 PM

Can you use FreeRTOS instead? https://www.freertos.org/index.html



#8 Labonte18

Labonte18
  • Topic Starter

  •  Avatar image
  • Members
  • 5 posts
  • OFFLINE
  •  
  • Local time:03:54 AM

Posted 18 March 2024 - 11:34 AM

Can you use FreeRTOS instead? https://www.freertos.org/index.html

there, perhaps, could be a migration down the road.. but no immediately. We've been on the On-Time RTOS for nearly 20 years, so migration.. While we can't rule out that we may have to move there at some point. That would be a project.



#9 greg18

greg18

  •  Avatar image
  • Members
  • 1,743 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Los Angeles, CA
  • Local time:02:54 AM

Posted 20 March 2024 - 03:45 AM

You need to start doing it now not later.

#10 Chiragroop

Chiragroop

  •  Avatar image
  • Members
  • 428 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:12:54 AM

Posted 01 June 2024 - 04:07 PM

FreeDOS has been supported for longer than Microsoft supported MS-DOS. That said, FreeDOS requires BIOS or UEFI with CSM/Legacy Boot turned on to work.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users