0

For an electrical-engineering research project, I'm looking for a way to have a code of a simple test-program running on a PC, to operate on an entire single-core while having full access to cpu resources and the entire non-virtual address space. No preemptions / threads etc. Just like in real-mode.
Real-mode however, is limited to 16-bit, while in this case, This is a modern PC and I need an access to the entire 64-bit address space.

So I'm looking for any distribution of linux / unix / any-os that boots directly into terminal and allowing nothing but a simple C program to run.

Or - a modern linux, that is already preconfigured for almost-nothing installed, and w/o any background processes / kernel-maintenance threads and so on..

Any ideas ?

Many thanks in advance !!!

ds_2001
  • 1
  • 1
  • I think this will be fundamentally unlike how Linux works, so I think that any such system you find will be not be Linux or anything like it. – Nate Eldredge Aug 21 '21 at 23:04
  • Also, 64-bit mode on x86-64 requires paging to be enabled, so you can't avoid having virtual memory. Of course, you can set up the page tables as an identity map if you want. – Nate Eldredge Aug 21 '21 at 23:05
  • You should be able to find bootloader examples that set up 64-bit mode, and a little more work would let you include C code. Of course you will have to write all I/O yourself - no standard library functions. – Nate Eldredge Aug 21 '21 at 23:06
  • Thanks @Nate Eldredge ! that seems exactly like what I’m looking for ( the bootloder approach ), good idea So should I take the source of grub and start playing from there? – ds_2001 Aug 22 '21 at 00:14
  • Or perhaps the tutorials at https://wiki.osdev.org/Main_Page, such as the "bare bones" examples. – Nate Eldredge Aug 22 '21 at 01:19
  • 1
    It's also possible that an x86 PC may not be the best type of machine for this purpose. It has a lot of fancy hardware that is not really designed to be convenient to access without a heavy OS and its infrastructure. You might want to consider something like Arduino, Raspberry Pi, other such lighter systems. – Nate Eldredge Aug 22 '21 at 01:21
  • See https://stackoverflow.com/q/68433286/1216776 – stark Aug 22 '21 at 11:21
  • I don't know if current CPUs still have "virtual x86 mode", but you could run MS-DOS in a virtual machine then. You won't have real access to CPU and RAM, however, but it might look like that. If you want the real x86 thing, get an old PC and run MS-DOS. – U. Windl Aug 26 '21 at 12:11

0 Answers0