Thread: Anyone any experience uploading bootloaders using C

  1. #1
    Registered User
    Join Date
    Dec 2023
    Posts
    6

    Unhappy Anyone any experience uploading bootloaders using C

    Below is my code without the "printf"-output code to check progress. I checked and it says that it writes the data.

    When I read back the result with a similar program, although it seems to have written the bootloader successfully at first, it returns all zeroes with the read program.

    I did make sure I have root permissions. I have the size of the program instead of PROGRAM_SIZE and the filename of the bootloader instead of "bootloader."

    I can't really tell whether there's something wrong with my programming or some kind of interference by the Operating System.

    Code:
    #include <stdio.h>
    
    
    unsigned char uca_CMOS[PROGRAM_SIZE] __attribute__((section(".ARM.__at_0x0000000000000000")));
    unsigned long int uli_counter = 0;
    FILE * Fp_load;
    
    
    int main(int i_argc, char** cpa_argv) {
      if (Fp_load = fopen("bootloader", "r")) {
        while (!feof(Fp_load)) {
          uca_CMOS[uli_counter] = getc(Fp_load);
          uli_counter++;
        }
        fclose(Fp_load);
      }
    }

  2. #2
    Registered User
    Join Date
    Dec 2023
    Posts
    2
    I'm not sure how the compiler you're using is interpreting __attribute__.

    At first glance, maybe it's writing to a 0x0000000000000000 memory address.

  3. #3
    Registered User
    Join Date
    Dec 2023
    Posts
    6

    Correct, I hope

    Quote Originally Posted by entrocraft View Post
    I'm not sure how the compiler you're using is interpreting __attribute__.

    At first glance, maybe it's writing to a 0x0000000000000000 memory address.
    The __attribute__ option should allow me to specify specific attributes of variables. The intent, as you identified it correctly, is to write to the absolute zero address, so when I reboot my computer the program it finds to boot up is the one I put there. I mean to upload my own bootloader.

    My main problem is that I have a lot of Bluetooth interference with pause, shutdown, kill, and block commands blocking my actions. This quite frequently leads to hardware tests not getting to or beyond 92% instead of testing a full 100% on other computers.

    My MacBook has been taken hostage by the DarkWeb and I've taken down a lot of their servers. I can tell my Internet is opening up and becoming less moderated, but I'm not quite there yet. As soon as I am, I'm going to put a lot of work into designing my own operating system ground up that doesn't allow for any of this.

  4. #4
    Registered User
    Join Date
    Mar 2023
    Posts
    33
    Quote Originally Posted by Emile Michel View Post
    The __attribute__ option should allow me to specify specific attributes of variables. The intent, as you identified it correctly, is to write to the absolute zero address, so when I reboot my computer the program it finds to boot up is the one I put there. I mean to upload my own bootloader.

    My main problem is that I have a lot of Bluetooth interference with pause, shutdown, kill, and block commands blocking my actions. This quite frequently leads to hardware tests not getting to or beyond 92% instead of testing a full 100% on other computers.

    My MacBook has been taken hostage by the DarkWeb and I've taken down a lot of their servers. I can tell my Internet is opening up and becoming less moderated, but I'm not quite there yet. As soon as I am, I'm going to put a lot of work into designing my own operating system ground up that doesn't allow for any of this.
    Hmmm, i was kind of confused by your post, but now i am starting to understand your intent with posting here now...

  5. #5
    Registered User
    Join Date
    Dec 2023
    Posts
    6
    Quote Originally Posted by C_me_run View Post
    Hmmm, i was kind of confused by your post, but now i am starting to understand your intent with posting here now...
    Sorry. I should have been a bit more specific in the post itself. It's easy to overlook the title. I also do it when I read it back.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. FTP uploading
    By geek@02 in forum C# Programming
    Replies: 6
    Last Post: 10-02-2012, 07:13 AM
  2. Bootloaders
    By (TNT) in forum Tech Board
    Replies: 2
    Last Post: 01-28-2006, 02:37 PM
  3. Uploading exe's
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 05-20-2005, 08:42 PM
  4. DOS experience 0 windows experience help
    By shrin2000 in forum Windows Programming
    Replies: 5
    Last Post: 07-15-2002, 02:22 AM

Tags for this Thread