Re: linux->real mode-> boot other OS in protected mode

From: Herbert Rosmanith (herp@wildsau.idv.uni.linz.at)
Date: Wed Mar 26 2003 - 03:07:24 EST


> > I boot Linux via BIOS, then boot DOS via LINUX
> > when I boot linux again via LINLD, the "Uncompressing Linux ..."
> > takes a lot longer as compared to doing a LINLD from a DOS which
> > was booted by BIOS. I think this has something to do with
> > switching.... oh! I know .... machine_real_start() from linux turns
> > off the cache, so this could be the reason. Ok, so I'll check this
> > out by chaning CR0.
>
> It is utterly strange that you can boot DOS from Linux at all.
>

well, not really.

machine_real_start() from process.c switches into 16 bit mode. you can pass
arbitrary code to that function. this code has to:
reset some hardware ---
  - reset 8259 interrupt controller, that is, IRQ mapping (IRQ0->INT8)
  - reset 8253 timer to 18,2 ticks per second (I think)
and then:
  - correctly initialize EBP, ESP to 0x7c0, SS to 0.
  - also clear bits 16-31 of EAX, EBX ....
and as a last step:
  - reset harddisk via int10
  - read sector 0 to 0x7c0
  - copy sector 0 to 0x600
  - far jmp to 0:0x7c0

with this, I can boot DOS with EMM (goes into protected mode) or even
boot Windows2k-server. the latter only on my EPIA-ITX board, on another
board, it unfortunately crashes as soon as it goes into protected mode,
that is, the machine looks like its performing a cold-start (warm-start?).
seems like a double- or triple-fault. any idea on how this can be debugged?

thanks in advance,
herbert

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Mar 31 2003 - 22:00:22 EST