mirror of
https://github.com/vivier/EMILE.git
synced 2025-02-03 01:32:31 +00:00
first revision
This commit is contained in:
parent
277cc9ffde
commit
af1851a9d4
25
libemile/emile_block0_write.c
Normal file
25
libemile/emile_block0_write.c
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
static __attribute__((used)) char* rcsid = "$CVSHeader$";
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* (c) 2004 Laurent Vivier <LaurentVivier@wanadoo.fr>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "partition.h"
|
||||||
|
#include "libemile.h"
|
||||||
|
|
||||||
|
int emile_block0_write(emile_map_t *map)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = lseek(map->fd, 0, SEEK_SET);
|
||||||
|
if (ret != 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
ret = write(map->fd, &map->drivers, sizeof(map->drivers));
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
29
libemile/emile_map_set_bootinfo.c
Normal file
29
libemile/emile_map_set_bootinfo.c
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
static __attribute__((used)) char* rcsid = "$CVSHeader$";
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* (c) 2004 Laurent Vivier <LaurentVivier@wanadoo.fr>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "partition.h"
|
||||||
|
#include "libemile.h"
|
||||||
|
|
||||||
|
int emile_map_set_bootinfo(emile_map_t *map, int bootstart, int bootsize,
|
||||||
|
int bootaddr, int bootentry, int checksum,
|
||||||
|
char* processor)
|
||||||
|
{
|
||||||
|
if (!emile_map_is_valid(map))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
map->partition.LgBootStart = bootstart;
|
||||||
|
map->partition.BootSize = bootsize;
|
||||||
|
map->partition.BootAddr = bootaddr;
|
||||||
|
map->partition.BootEntry = bootentry;
|
||||||
|
map->partition.BootCksum = checksum;
|
||||||
|
memset(map->partition.Processor, 0, sizeof(map->partition.Processor));
|
||||||
|
strcpy(map->partition.Processor, processor);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
25
libemile/emile_map_set_driver_info.c
Normal file
25
libemile/emile_map_set_driver_info.c
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
static __attribute__((used)) char* rcsid = "$CVSHeader$";
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* (c) 2004 Laurent Vivier <LaurentVivier@wanadoo.fr>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "partition.h"
|
||||||
|
#include "libemile.h"
|
||||||
|
|
||||||
|
int emile_map_set_driver_info(emile_map_t *map, int number,
|
||||||
|
int block, int size, int type)
|
||||||
|
{
|
||||||
|
if (!emile_map_is_valid(map))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (number >= DD_MAX_DRIVER)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
map->drivers.DrvInfo[number].Block = block;
|
||||||
|
map->drivers.DrvInfo[number].Size = size;
|
||||||
|
map->drivers.DrvInfo[number].Type = type;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
22
libemile/emile_map_set_driver_number.c
Normal file
22
libemile/emile_map_set_driver_number.c
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
static __attribute__((used)) char* rcsid = "$CVSHeader$";
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* (c) 2004 Laurent Vivier <LaurentVivier@wanadoo.fr>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "partition.h"
|
||||||
|
#include "libemile.h"
|
||||||
|
|
||||||
|
int emile_map_set_driver_number(emile_map_t *map, int number)
|
||||||
|
{
|
||||||
|
if (!emile_map_is_valid(map))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (number >= DD_MAX_DRIVER)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
map->drivers.DrvrCount = number;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user