mirror of
https://github.com/vivier/EMILE.git
synced 2025-01-18 06:31:23 +00:00
set first, second and kernel parameters, it's a draft...
This commit is contained in:
parent
9695ef4eb5
commit
ad5745956a
@ -15,27 +15,51 @@
|
||||
|
||||
#include "libemile.h"
|
||||
|
||||
/* first second kernel buffer_size command_line */
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int fd;
|
||||
short id;
|
||||
int ret;
|
||||
|
||||
fd = open(argv[1], O_RDWR);
|
||||
/* set kernel info in second level */
|
||||
|
||||
fd = open(argv[2], O_RDWR); /* second */
|
||||
if (fd == -1)
|
||||
{
|
||||
perror("Cannot open second stage");
|
||||
return 1;
|
||||
}
|
||||
|
||||
ret = read(fd, &id, 2);
|
||||
/* set buffer size */
|
||||
|
||||
printf("Setting buffer size to %d\n", atoi(argv[4]));
|
||||
ret = emile_second_set_kernel(fd, NULL, 0, atoi(argv[4]), NULL);
|
||||
|
||||
/* set cmdline */
|
||||
|
||||
lseek(fd, 0, SEEK_SET);
|
||||
if ( (ret == 2) && (id == 0x4C4B) )
|
||||
emile_first_set_param_scsi(fd, argv[2]);
|
||||
else
|
||||
emile_second_set_kernel_scsi(fd, argv[2]);
|
||||
|
||||
printf("Setting command line to %s\n", argv[5]);
|
||||
ret = emile_second_set_cmdline(fd, argv[5]);
|
||||
|
||||
/* set kernel info */
|
||||
|
||||
lseek(fd, 0, SEEK_SET);
|
||||
ret = emile_second_set_kernel_scsi(fd, argv[3]);
|
||||
|
||||
close(fd);
|
||||
|
||||
/* set second info in first level */
|
||||
|
||||
fd = open(argv[1], O_RDWR);
|
||||
if (fd == -1)
|
||||
{
|
||||
perror("Cannot open first stage");
|
||||
return 1;
|
||||
}
|
||||
|
||||
ret = emile_first_set_param_scsi(fd, argv[2]);
|
||||
close(fd);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user