Operating System Questions in Assembly

Started by
11 comments, last by Norman Barrows 7 years, 11 months ago
I am building an operating system in Assembly and I need to add a background image. How do I do this? Also, I need my operating system to run exe files, how do I make it do that?
Advertisement
Executables on Windows follow the PE Format. Note that to run Windows executables you not only have to interpret the data format correctly you will also have to emulate a considerable part of the Windows runtime environment. Wine might be a good starting point for that.

Also note that it is generally an extremely horrible idea to put two completely different questions into the same thread.

hello,

i recommend you to checkout

here

and

here

you will find many tutorials there

when you can't see well like me, you can't test your applications and you can't read something

Github

Based on your question, I think you should step back and evaluate your ability to complete this project.

Honestly, you are building a space shuttle and you've just asked about spray painting the NASA logo on the side.

I'm not trying to be mean, but I think you've seriously underestimated the difficulty of what you are trying to do.
if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight

Yeah if you're trying to run exe files you're just going to make a windows/dos clone. Whats the point in that? More importantly do you realize how complicated that is and how much reverse engineering is necessary? Why exactly are you trying to develop an OS? A learning experience? Learn more about OS programming and then decide if you want to go that route and moreover what subroute (there's a lot of ways to proceed).

-potential energy is easily made kinetic-

What have you done so far?

There are several prerequisites to loading an executable, firstly the executable can't just be a windows executable with Windows calls and links to Windows dlls. Operating systems don't "just load executables" like that.

The prerequisites I can think of, that you need to solve first are below. I've peppered this with links you can read up on to give you some idea of where to turn.

1) your OS needs proper paging and virtual memory and a memory manager
2) you need a dynamic linker with symbol resolution
3) you need to be able to read and write from at least one type of file system where the executable code is stored
4) you need to decide on an executable format, be it PE COFF, ELF64 or whatever. Seriously, i recommend ELF instead.
5) you need both a kernel level and user level api, e.g. userland and the programs to go with it
6) porting a compiler would definitely be a plus
7) you'll need to support the basics of the C runtime in your userland
8) to display graphics you then need to support the frame buffer device which means enumerating the pci bus, identifying and enabling the graphics card, switching to graphics mode and mapping the frame buffer to kernel memory. This differs from graphics card to graphics card and is no mean feat in itself,it took Linux decades to get this to be reliable and for it to "just work". They had backing of nvidia, amd etc too.
9) you then need to port a graphics library like gd to load your image to the frame buffer. If you've done every other step, it should now be a simple set of function calls.

Seriously, good luck because I'm not sure you have much clue where you're going right now. Writing an OS takes decades, and is more complex than game development.

My source: dabbling in OS Dev as a sideline project. See: https://brainbox.cc/retro-rocket-operating-system

Good luck, you'll need it!

For deeper insights in how an OS works, you can read books like "The design and implementation of the BSD operating system". No doubt similar books exist for the Linux kernel. It's a 550 page dense technical detailed description of the design considerations and data structures that are used to realize the BSD OS.

At a higher level (more abstract) there are books like "The design of the Unix operating system", but these don't go into much detail.

Based on your question, I think you should step back and evaluate your ability to complete this project.

Honestly, you are building a space shuttle and you've just asked about spray painting the NASA logo on the side.


The OP is (according to their profile) thirteen. Personally, for that age group I find it advisable to just give them the information desired and let the empirical values of something deceptively simple-sounding become a huge problem be a first-hand experience. We get a lot of older people who really should have learned that lesson earlier.

It's not even wasted time (especially at that age). You will be gaining skill points all over the place while working on it even with the originally intended goal not achievable.

Based on your question, I think you should step back and evaluate your ability to complete this project.

Honestly, you are building a space shuttle and you've just asked about spray painting the NASA logo on the side.


The OP is (according to their profile) thirteen. Personally, for that age group I find it advisable to just give them the information desired and let the empirical values of something deceptively simple-sounding become a huge problem be a first-hand experience. We get a lot of older people who really should have learned that lesson earlier.

It's not even wasted time (especially at that age). You will be gaining skill points all over the place while working on it even with the originally intended goal not achievable.


I disagree. When I was that age, I was constantly trying to build things way beyond my ability, and similarly, I would focus on the "fun stuff", because the actual work frustrated me.

This was before the internet, so I didn't really have any help other than whatever books I could find. So I basically gave up in frustration, and didn't get back to programming until years later.

I really wish someone would have said to me "look, try something more manageable".

if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight

Based on your question, I think you should step back and evaluate your ability to complete this project.

Honestly, you are building a space shuttle and you've just asked about spray painting the NASA logo on the side.


The OP is (according to their profile) thirteen. Personally, for that age group I find it advisable to just give them the information desired and let the empirical values of something deceptively simple-sounding become a huge problem be a first-hand experience. We get a lot of older people who really should have learned that lesson earlier.

It's not even wasted time (especially at that age). You will be gaining skill points all over the place while working on it even with the originally intended goal not achievable.

Subconscious assumptions are made of posters and so unfortunately not everyone bothers to checks an OP's profile first before replying. It is good you checked, it will be good if most of us did. On the other hand, since OP is that young... if he had posted the question in beginner's forum (with a brief self intro if it's first time?... no, its not OP's first post), ... probably some replies would have been more sympathetic, with a more simplistic guiding hand on what is feasible, what is not, why and how

can't help being grumpy...

Just need to let some steam out, so my head doesn't explode...

This topic is closed to new replies.

Advertisement