Bona Fide OS Developer
View unanswered posts | View active topics It is currently Sun Feb 25, 2018 4:43 am



Post new topic Reply to topic  [ 7 posts ] 
 32 bit assembly OS 
Author Message

Joined: Tue Nov 23, 2010 10:12 pm
Posts: 2
Post 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


Tue Nov 23, 2010 10:23 pm
Profile

Joined: Sat Jul 03, 2010 8:07 am
Posts: 44
Location: Clarkesville, GA, USA
Post 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.

_________________
After Monday and Tuesday, even the calendar says WTF.


Wed Nov 24, 2010 9:54 am
Profile WWW

Joined: Tue Nov 23, 2010 10:12 pm
Posts: 2
Post 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.


Tue Nov 30, 2010 12:04 am
Profile

Joined: Sat Jul 03, 2010 8:07 am
Posts: 44
Location: Clarkesville, GA, USA
Post 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.

_________________
After Monday and Tuesday, even the calendar says WTF.


Tue Nov 30, 2010 9:19 am
Profile WWW

Joined: Thu Dec 23, 2010 1:12 pm
Posts: 9
Post 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.


Wed Mar 23, 2011 4:52 pm
Profile

Joined: Thu Dec 23, 2010 1:12 pm
Posts: 9
Post Re: 32 bit assembly OS
Sorry, I didn't notice it was an old post.


Wed Mar 23, 2011 4:53 pm
Profile
Site Admin

Joined: Fri Jul 24, 2009 10:02 pm
Posts: 247
Location: Las Vegas, NV, US
Post 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!


Tue Aug 23, 2011 1:27 am
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin and tweaked by the BF Team.