![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-12 01:16 |
47,811 topics / 349,897 posts / today 0 new / 48,256 members |
| GRUB4DOS、SYSLINUX及其它启动管理软件讨论专区 » Question about grub4dos, can it be solved? |
| Printable Version 1,655 / 5 |
| Floor1 xingjia | Posted 2006-04-06 17:02 |
| 新手上路 Posts 3 Credits 10 | |
|
I want to boot a DOS floppy disk image through PXE and enter a DOS environment. In this DOS environment, use a DOS RAM disk to create a virtual drive. In this virtual drive, put the Linux kernel and initrd. Can the Linux kernel be booted through grub4dos?
|
|
| Floor2 fujianabc | Posted 2006-04-07 11:46 |
| 金牌会员 Posts 1,616 Credits 3,467 | |
|
The most basic function of grub is to boot the Linux kernel; all the other functions were added later.
|
|
| Floor3 xingjia | Posted 2006-04-07 14:58 |
| 新手上路 Posts 3 Credits 10 | |
|
The problem is this: when grub4dos reads the Linux kernel, it does so from a real hard disk or floppy disk, root(hd*,*). It seems there is no way to directly read the kernel file from a DOS RAM virtual drive.
|
|
| Floor4 tinybit | Posted 2006-04-07 15:10 |
| 初级用户 Posts 57 Credits 137 | |
|
That depends on whether you're lucky or not. Since the floppy disk image is in memory, if after entering GRUB you can still find that image in memory, and preferably the image is also contiguous in memory, then it can succeed; otherwise, I'm afraid you'll have to think of another way.
What can be confirmed now is that all sectors in your floppy disk are already in memory. You can use the format (md)XXXXXX+XXXXXX to access a sequence of sectors in memory (you need to fill in suitable values for XXXXXX): map (md)XXXXXX1+YYYYYY1,XXXXXX2+YYYYYY2,XXXXXX3+YYYYYY3 (fd0) map --hook Then you can access the files in the floppy disk. But the difficulty lies in determining the value of XXXXXX; you'll need to decide it manually, which is quite troublesome. So I suggest that the floppy disk image executed from PXE directly use a GRUB-booted floppy, that is, the boot sector of the floppy directly uses the boot sector of GRLDR (such a floppy boot sector can be created with the bootlace command). To put it more clearly, this floppy does not contain DOS, and you should never have a step of entering DOS. That way, when GRUB gets control, GRUB can access the floppy passed in from PXE; in fact, it is just (fd0). In this way, anything on your floppy can be conveniently operated on under GRUB (you won't even need to use the map command anymore). If the latter method doesn't suit your taste, then you can still consider modifying the former method. Under DOS, find a way to place the entire floppy image into some fixed, contiguous area of memory, for example at physical address 0x400000, that is, at 4M, then enter GRUB and use map (md)0x2000+2880 (fd0) map --hook to emulate it, and that will be OK. To explain: 0x2000 multiplied by the sector size 0x200 is 0x400000 2880 indicates the total number of sectors on the floppy disk. |
|
| Floor5 xingjia | Posted 2006-04-07 16:47 |
| 新手上路 Posts 3 Credits 10 | |
|
Many thanks for tinybit's reply.
The second solution you mentioned really cannot meet my needs. I must first boot DOS from PXE, do some other operations in DOS, and then switch into Linux. Originally I was using loadlin for this, but loadlin has size limits on both kernel and initrd, so I want to try grub4dos. I will test according to the first solution you mentioned. Thanks again. |
|
| Floor6 tinybit | Posted 2006-04-07 18:38 |
| 初级用户 Posts 57 Credits 137 | |
|
Since you have this special requirement, if possible, I can also consider having GRUB.EXE copy the DOS floppy to one contiguous area right at the beginning of startup. Use int13 to read the contents of the DOS RAM disk, then write them into extended memory, while making sure overlapping problems are properly handled. But I don't have time to deal with this at the moment, so let's talk about it later (this may be delayed a long time, several months, maybe even a year). For now you'll have to think of a way to make do with it yourself first.
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |