Date: Thu, 6 Dec 2001 19:16:02 +0300 From: Dmitry Konyshev <daemon@agava.com> To: Terry Lambert <tlambert2@mindspring.com> Cc: freebsd-hackers@FreeBSD.ORG Subject: Re[2]: switching to real mode Message-ID: <1080523636.20011206191602@agava.com> In-Reply-To: <3C0F89FC.EA91E6A1@mindspring.com> References: <3972603197.20011206170402@agava.com> <3C0F89FC.EA91E6A1@mindspring.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Hello Terry, Thursday, December 06, 2001, 6:08:44 PM, you wrote: TL> Dmitry Konyshev wrote: >> For some odd reason I need to load another OS (no matter which one, >> everything that known about it is its boot sector number) >> at the end of the reboot syscall. Could someone please explain how to >> switch processor to real mode and continue program execution from some >> point in low memory? TL> The system is not reset to real mode on reboot. TL> To reset the system to real mode, you should probably copy the TL> VM86 memory area over low core, and switch that way. It will TL> be incredibly difficult. You might also be able to re-POST TL> the low core memory with a software reset in VM86, but I would TL> not rely on this not really resetting the machine. TL> The real problem is the interrupt routing table and the active TL> devices which may result in interrupts during this process; if TL> you take away the FreeBSD IRQ routing and substitute the BIOS TL> routing, things will probably go to hell. At the very least, TL> using BIOS services will be unreliable, unless all devices are TL> returned to POST state (I had a system at one time that did not TL> reset UART state on POST, and the serial ports ceased to work TL> correctly without a power off, since the Xenix I was running TL> enabled the FIFOs, and the BIOS post did not disable them). TL> A better alternative would be to simply mark the target partition TL> as "active" and reboot normally (assuming that you don't want to TL> reboot to FreeBSD on power on, and then switch to another OS on TL> a soft reboot only). Most "multiboot" boot managers will mark TL> the booting partition as active as part of their boot selection TL> process. I thought of this way, but it might seem "strange" for a user if her computer would want to reboot without any obvious reason. I'll keep this way in mind for the case I fail to implement it in more user-friendly manner. :) I saw an example of switching in real mode in linux' sources (it looks pretty clear) and thouhgt it is possible to do the same under FreeBSD. The problem is I'm absolutely lost in FreeBSD's physical memory management implementation (page tables and directory and so on). Devices states shouldn't be a problem because version of FreeBSD I'm going to use will have minimal option. Anyway I could reset such devices (if any) manually before loading other OS. TL> Without a better understanding of why it is you think you want TL> to do this evil thing, I can only suggest reading: TL> Protected Mode Software Architecture TL> Tom Shanley TL> Mindshare, Inc. TL> Addison-Wesley Publishing Company TL> ISBN 0-201-5447-X TL> -- Terry -- Best regards, Dmitry mailto:daemon@agava.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1080523636.20011206191602>