Bona Fide OS Development
http://forums.osdever.net/

32 bit assembly OS
http://forums.osdever.net/viewtopic.php?f=5&t=856
Page 1 of 1

Author:  mos [ Tue Nov 23, 2010 10:23 pm ]
Post subject:  32 bit assembly OS

I am creating a 32 bit OS that will have a hybrid kernel. I am stuck, i don't know where to go from here, i don't know much assembly. I would like to make an interpreter so that I can run files from any architecture, I would like to make my own DOS in a sense.

Kernel:

Code:
; Moutans Xbios Kernel

; --------------------------------------------
;  Here is the operating system entry point
; --------------------------------------------
begin:
   mov   ax, cs      ; Get the current segment
   mov   ds, ax      ; The data is in this segment
   cli         ; disable interrupts while changing stack
   mov   ss, ax      ; We'll use this segment for the stack too
   mov   sp, 0xfffe   ; Start the stack at the top of the segment
   sti         ; Reenable interrupts

   mov   si, msg      ; load address of our message
   call   putstr      ; print the message

hang:
   jmp   hang      ; just loop forever.

; --------------------------------------------
; data for our program

msg   db   'Loading Kernal (Xbios Beta)...', 0

; ---------------------------------------------
; Print a null-terminated string on the screen
; ---------------------------------------------
putstr:
   lodsb      ; AL = [DS:SI]
   or al, al   ; Set zero flag if al=0
   jz putstrd   ; jump to putstrd if zero flag is set
   mov ah, 0x0e   ; video function 0Eh (print char)
   mov bx, 0x0018   ; color
   int 0x10
   jmp putstr
putstrd:
   retn

[BITS 32]; protected mode

Author:  Ford [ Wed Nov 24, 2010 9:54 am ]
Post subject:  Re: 32 bit assembly OS

mos wrote:
I am creating a 32 bit OS that will have a hybrid kernel. I am stuck, i don't know where to go from here, i don't know much assembly. I would like to make an interpreter so that I can run files from any architecture, I would like to make my own DOS in a sense.


Your interpreter is going to take years to build and may not be legal... A while back I was working on a Linux distribution that was actually becoming capable of running Windows, OSX, and native Linux binaries. We ordered a listing of Microsoft and Apple patents that pertained to our project only to find out that all of the work we had done was illegal. We didn't use their code, but they both had various patents that were impossible to work around. That was 3 years of work down the drain. Likewise, there are a lot of various patents regarding emulation technologies for hardware, and various patents regarding how binaries are run on various platforms. This is increasing true with things like MIPS and Alpha.

Author:  mos [ Tue Nov 30, 2010 12:04 am ]
Post subject:  Re: 32 bit assembly OS

I don't want to create an interpreter that will be able to run files from other operating systems. I want to make a interpreter with it's own programming language that can run on 64bit and 32bit architectures, which requires that I program 2 OS's.

Author:  Ford [ Tue Nov 30, 2010 9:19 am ]
Post subject:  Re: 32 bit assembly OS

mos wrote:
I don't want to create an interpreter that will be able to run files from other operating systems. I want to make a interpreter with it's own programming language that can run on 64bit and 32bit architectures, which requires that I program 2 OS's.


Not quite two OSs. Linux, Windows, and OSX can all run 32bit and 64bit programs in their 64bit versions. These are called "multilib" systems. You can do the same in 32bit with 16bit binaries, and the same in 16bit with 8bit binaries. Where you will have problems is if you want to run 64bit binaries in a 32bit machine. In this case, you need some kind of processor emulation.

Author:  jflanagan987 [ Wed Mar 23, 2011 4:52 pm ]
Post subject:  Re: 32 bit assembly OS

Don't start thinking about making a multilib system or interpreter yet. Set up the simple things first. I recommend that you use c as well as asm. Some tutorials are: http://www.osdever.net/bkerndev/Docs/title.htmand http://www.jamesmolloy.co.uk/tutorial_html/index.html. These helped me learn how to make an OS.

Author:  jflanagan987 [ Wed Mar 23, 2011 4:53 pm ]
Post subject:  Re: 32 bit assembly OS

Sorry, I didn't notice it was an old post.

Author:  brenden [ Tue Aug 23, 2011 1:27 am ]
Post subject:  Re: 32 bit assembly OS

jflanagan987 wrote:
Don't start thinking about making a multilib system or interpreter yet. Set up the simple things first. I recommend that you use c as well as asm. Some tutorials are: http://www.osdever.net/bkerndev/Docs/title.htmand http://www.jamesmolloy.co.uk/tutorial_html/index.html. These helped me learn how to make an OS.


Great point. Hobby OS development is all about baby steps and learning one thing at a time. Aspire to do great things as you learn to do simple things. It all adds up.

Thanks for commenting jflanagan987!

Page 1 of 1 All times are UTC - 6 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/