My Project
Chargement...
Recherche...
Aucune correspondance
taillenoyau.c
Aller à la documentation de ce fichier.
1 A PRIORI C'EST OBSOLETE !!
2
3 A VIRER DONC NON ? *
4
5/*----------------------------------------------------------------------------*/
6/* Outils permettant de générer un taille.conf pour la compilation de */
7/* ManuX */
8/* (C) Manu Chaput 2000-2021 */
9/*----------------------------------------------------------------------------*/
10#include <stdio.h>
11#include <sys/stat.h>
12#include <unistd.h>
13#include <error.h>
14
15#define TAILLE_BLOC 512
16
17int main(int argc,char * argv[])
18{
19 int nbBlocs ; // Nombre de blocs du noyau
20 int tailleBourage; // Pour un nombre entier de blocs
21 int premierSecteurRamDisk; // Nécessaire lors du chargement
22
23 struct stat statNoyau, statInit;
24
25 if (stat(argv[1], &statNoyau)) {
26 perror("stat");
27 return 1;
28 }
29
30 nbBlocs = ((int) statNoyau.st_size + TAILLE_BLOC)/TAILLE_BLOC;
31 tailleBourage = nbBlocs * TAILLE_BLOC - (int) statNoyau.st_size;
32
33 /*
34 if (stat(argv[2], &statInit)) {
35 perror("stat");
36 return 1;
37 }
38 premierSecteurRamDisk = nbBlocs + ((int) statInit.st_size)/TAILLE_BLOC;
39 */
40
41 printf("# Fichier généré automatiquement, ne pas modifier\nMANUX_NB_SECT_KERNEL = %d\nMANUX_TAILLE_BOURRAGE = %d\n",
42 nbBlocs,
43 tailleBourage);
44
45 return 0;
46}