Find the answer to your Linux question:
Results 1 to 10 of 10
does any body know if there is a way to convert linux executables to microcode i know that the kernel has to do this but i am wondering if it ...
  1. #1
    Just Joined!
    Join Date
    Mar 2009
    Posts
    37

    .bin to microcode

    does any body know if there is a way to convert linux executables to microcode
    i know that the kernel has to do this but i am wondering if it can be done through the shell, scripts, nasm, or gcc

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    Please be more specific about what you are trying to accomplish.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Mar 2009
    Posts
    37
    i am trying to convert a linux binary to microcode format so i can put it in the boot sector of a floppy and run it when i boot.

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    Quote Originally Posted by driechers View Post
    i am trying to convert a linux binary to microcode format so i can put it in the boot sector of a floppy and run it when i boot.
    That's better. It is machine code. Microcode are instructions internal to a processor. Some of these can be updated on boot, as does my Intel workstation. Two different beasts. You need to strip all the symbols out and make sure that there are no library calls - everything in the boot loader has to be a short jump - remember that you only have a few hundred bytes of instruction space to use as the boot sector is 512 bytes, including the partition table. In any case, you are better off using an assembler, such as nasm, to build your binary file. You also need to understand EXACTLY what happens when the system tries to boot a disc. This is where you need to know all about the BIOS instruction set and interrupts to call BIOS code, such as to load a specific disc sector into memory, where it is loaded, how to relocate that sector, jump to the proper vector in the code, read the partition table in the boot sector, determine which is the active partition, then determine where the actual boot data is. The list of stuff you need to do goes on. Somewhere in all this, your custom code needs to be dealt with as well. I know because I wrote some OEM boot loaders 20-something years ago.

    What I am saying, is that you REALLY need to know what you are doing, and from what I infer from your message, you have about a month of intensive study before you are ready to start programming your loader, and I expect that in that process you will figure out how to compile/assemble it to a state that can be installed on disc.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Just Joined!
    Join Date
    Mar 2009
    Posts
    37
    i can make the box boot up into real mode then get it into protected mode i have made my own insane filesystem, but because it is not compatible with any other os their is not much that i can do because the only way that i can make a program is with assembly. but i would like a way to compile and execute c programs from my os do you know of any way that i could get a compiler on my os that could out put micro code?

  6. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    Quote Originally Posted by driechers View Post
    i can make the box boot up into real mode then get it into protected mode i have made my own insane filesystem, but because it is not compatible with any other os their is not much that i can do because the only way that i can make a program is with assembly. but i would like a way to compile and execute c programs from my os do you know of any way that i could get a compiler on my os that could out put micro code?
    Ok. So you are building an OS - talk about reinventing the wheel! Should I call you Ogg? . A number of possibilities come to mind. To wit (or nitwit - you choose!):

    1. Write a device driver for Linux to support your file system. That way you get use of all those great Linux tools like GCC, etc.
    2. Port GCC to your "OS" - much more work than #1 I think.
    3. Port a C compiler that can produce assembler code you can use, leaving off the normal system stuff like the loader. How are you dealing with that, anyway? You say you are running in protected mode?

    Anyway, there's a lot to be done in any case. You might be able to coerce GCC to produce object files without the normal Linux module load instructions and library support - you will have to statically link in any case. No shared libraries for you, at least at this point.

    So, it sounds like either you are having fun with your little project, or you are having a miserable time in a computer science class somewhere. Enquiring minds, and all that...
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #7
    Just Joined!
    Join Date
    Mar 2009
    Posts
    37
    that sounds like fun and yes i like re inventing the wheel.
    why?
    because i can.

  8. #8
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    Quote Originally Posted by driechers View Post
    that sounds like fun and yes i like re inventing the wheel.
    why?
    because i can.
    Good for you! I'm sorry that I don't have a quick/easy answer for you. Most of my software development is at the 10,000ft level - large scale distributed systems software. My last stint with low-level stuff that needed assembler was writing a pseudo-device driver for QNX so I could implement the telnet protocols for that operating system, and that was in 1991 I think. The last boot loader I wrote was in 1987. So, you can see that my skills in this department are sorely out of date! And though I have written a number of interpreters and CLIPS type of rule language processors, I haven't written a complete compiler per se. I think that's about the only major hole in my software experience profile.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  9. #9
    Just Joined!
    Join Date
    Mar 2009
    Posts
    37
    lol my dad worked on that.

  10. #10
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    Quote Originally Posted by driechers View Post
    lol my dad worked on that.
    On what, QNX? Or on Telnet?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...