grub2中如何发送自定义的scsi命令!

启动讨论 grub/grub2/syslinux/grub4dos/Lilo
回复
ymjkk
帖子: 6
注册时间: 2008-06-25 11:27

grub2中如何发送自定义的scsi命令!

#1

帖子 ymjkk » 2017-04-27 16:24

因为一些定制的需要,我想在grub2中发送自定的scsi命令,就是一些自定义的读写操作,针对特殊的设备,应该怎么做呢?查看源码没有找到添加scsi命令的地方。
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: grub2中如何发送自定义的scsi命令!

#2

帖子 poloshiao » 2017-04-27 20:01

我想在grub2中发送自定的SCSI命令,就是一些自定义的读写操作,针对特殊的设备,应该怎么做呢?
1. Grub 無法區分 IDE, ESDI, SCSI 或 其它裝置
http://mcs.une.edu.au/doc/grub2-tools/grub.html
1-1. Note that GRUB does not distinguish IDE from SCSI - it simply counts the drive numbers from zero, regardless of their type. Normally, any IDE drive number is less than any SCSI drive number, although that is not true if you change the boot sequence by swapping IDE and SCSI drives in your BIOS.
1-2. Historically, the device map file was used because GRUB device names had to be used in the configuration file, and they were derived from BIOS drive numbers. The map between BIOS drives and OS devices cannot always be guessed correctly: for example, GRUB will get the order wrong if you exchange the boot sequence between IDE and SCSI in your BIOS.
1-3. GRUB uses a special syntax for specifying disk drives which can be accessed by BIOS. Because of BIOS limitations, GRUB cannot distinguish between IDE, ESDI, SCSI, or others. You must know yourself which BIOS device is equivalent to which OS device. Normally, that will be clear if you see the files in a device or use the command search (see search).

2. 不知道 跟你的指令 有無關聯
ymjkk
帖子: 6
注册时间: 2008-06-25 11:27

Re: grub2中如何发送自定义的scsi命令!

#3

帖子 ymjkk » 2017-04-28 10:50

poloshiao 写了:
我想在grub2中发送自定的SCSI命令,就是一些自定义的读写操作,针对特殊的设备,应该怎么做呢?
1. Grub 無法區分 IDE, ESDI, SCSI 或 其它裝置
http://mcs.une.edu.au/doc/grub2-tools/grub.html
1-1. Note that GRUB does not distinguish IDE from SCSI - it simply counts the drive numbers from zero, regardless of their type. Normally, any IDE drive number is less than any SCSI drive number, although that is not true if you change the boot sequence by swapping IDE and SCSI drives in your BIOS.
1-2. Historically, the device map file was used because GRUB device names had to be used in the configuration file, and they were derived from BIOS drive numbers. The map between BIOS drives and OS devices cannot always be guessed correctly: for example, GRUB will get the order wrong if you exchange the boot sequence between IDE and SCSI in your BIOS.
1-3. GRUB uses a special syntax for specifying disk drives which can be accessed by BIOS. Because of BIOS limitations, GRUB cannot distinguish between IDE, ESDI, SCSI, or others. You must know yourself which BIOS device is equivalent to which OS device. Normally, that will be clear if you see the files in a device or use the command search (see search).

2. 不知道 跟你的指令 有無關聯
不是,不管他是否区分设备,最终要实现读写,他其实都是通过scsi命令进行的吧,我只是想在他发送命令的时候增加一个命令,这个命令格式是标准的scsi命令格式,只不过命令本身是自定义的,实现对特定地址的读写,这些device的固件已经做了修改,但是我如何能在grub启动的时候发送这些命令,要收到了上层命令,固件才会做读写特定地址。
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: grub2中如何发送自定义的scsi命令!

#4

帖子 poloshiao » 2017-04-28 12:14

http://mcs.une.edu.au/doc/grub2-tools/g ... figuration
6.4 Embedding a configuration file into GRUB
GRUB supports embedding a configuration file directly into the core image, so that it is loaded before entering normal mode. This is useful, for example, when it is not straightforward to find the real configuration file, or when you need to debug problems with loading that file. grub2-install uses this feature when it is not using BIOS disk functions or when installing to a different disk from the one containing /boot/grub, in which case it needs to use the search command (see search) to find /boot/grub.

看看 這個 在 grub 嵌入 一個設定檔 的功能
適合嗎
回复