Question on installing new bootloader

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear developers:

I'm trying to install a new bootloader on a computer. My angle was to write it to the zero address of the CMOS as follows, but the result is a SEGMENTATION FAULT. How do I write to the zero address using C?

-- CODE --

#include <stdio.h>

int main (int argc, char* argv[]) {
  unsigned char* mem;
  FILE* load;

  mem = 0;
  load = fopen("bootloader", "r");
  while (!feof(load)) {
    *mem = getc(load);
    mem++;
  }
  fclose(load);
}

-- END OF CODE --

It should just do this, but it doesn't. What stands in my way? C is a low level programming language that's advertised as being suitable for system programming, which would include a bootloader. I did make sure to include the bootloader in the same directory as the executable.

Kind regards,

Emile Michel Hobo van Oranje (recognized by the Supreme Court of the Netherlands)




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux