diff --git a/libemile/emile_block0_write.c b/libemile/emile_block0_write.c new file mode 100644 index 0000000..ae2d535 --- /dev/null +++ b/libemile/emile_block0_write.c @@ -0,0 +1,25 @@ +static __attribute__((used)) char* rcsid = "$CVSHeader$"; +/* + * + * (c) 2004 Laurent Vivier + * + */ + +#include +#include + +#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; +} diff --git a/libemile/emile_map_set_bootinfo.c b/libemile/emile_map_set_bootinfo.c new file mode 100644 index 0000000..cf2db73 --- /dev/null +++ b/libemile/emile_map_set_bootinfo.c @@ -0,0 +1,29 @@ +static __attribute__((used)) char* rcsid = "$CVSHeader$"; +/* + * + * (c) 2004 Laurent Vivier + * + */ + +#include + +#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; +} diff --git a/libemile/emile_map_set_driver_info.c b/libemile/emile_map_set_driver_info.c new file mode 100644 index 0000000..14600e5 --- /dev/null +++ b/libemile/emile_map_set_driver_info.c @@ -0,0 +1,25 @@ +static __attribute__((used)) char* rcsid = "$CVSHeader$"; +/* + * + * (c) 2004 Laurent Vivier + * + */ + +#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; +} diff --git a/libemile/emile_map_set_driver_number.c b/libemile/emile_map_set_driver_number.c new file mode 100644 index 0000000..1f6b8e4 --- /dev/null +++ b/libemile/emile_map_set_driver_number.c @@ -0,0 +1,22 @@ +static __attribute__((used)) char* rcsid = "$CVSHeader$"; +/* + * + * (c) 2004 Laurent Vivier + * + */ + +#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; +}