Get Paid to Participate     Twitter     Facebook     Google+
Hosting Discussion
 

forgot password?


Reply


Old
  Post #1 (permalink)   03-15-2004, 08:05 AM
HD Wizard
 
Join Date: Aug 2003
Posts: 1,003

Status: gooooogle is offline
Well another of my strange interests is how things works and so I've been looking at the source code of a hello world operating system. The code is written in assembly and compiled using NASM.

Quote:
[BITS 16] ; 16 bit code generation
[ORG 0x7C00] ; Origin location

; Main program
main: ; Label for the start of the main program

mov ax,0x0000 ; Setup the Data Segment register
; Location of data is DS:Offset
mov ds,ax ; This can not be loaded directly it has to be in two steps.
; 'mov ds, 0x0000' will NOT work due to limitations on the CPU

mov si, HelloWorld ; Load the string into position for the procedure.
call PutStr ; Call/start the procedure

jmp $ ; Never ending loop

; Procedures
PutStr: ; Procedure label/start
; Set up the registers for the interrupt call
mov ah,0x0E ; The function to display a chacter (teletype)
mov bh,0x00 ; Page number
mov bl,0x07 ; Normal text attribute

.nextchar ; Internal label (needed to loop round for the next character)
lodsb ; I think of this as LOaD String Block
; (Not sure if thats the real meaning though)
; Loads [SI] into AL and increases SI by one
; Check for end of string '0'
or al,al ; Sets the zero flag if al = 0
; (OR outputs 0's where there is a zero bit in the register)
jz .return ; If the zero flag has been set go to the end of the procedure.
; Zero flag gets set when an instruction returns 0 as the answer.
int 0x10 ; Run the BIOS video interrupt
jmp .nextchar ; Loop back round tothe top
.return ; Label at the end to jump to when complete
ret ; Return to main program

; Data

HelloWorld db 'Saluton Mondo',13,10,0

; End Matter
times 510-($-$$) db 0 ; Fill the rest with zeros
dw 0xAA55 ; Boot loader signature
I've compiled and run this operating system from a diskette and it works. Although technically speaking this is only a bootloader and not a complete os as there is no actual kernel involved.

Note: Saluton Mondo is Hello World in esperanto.
Note Again: This code was written by Daniel Faulkner and is available at osdever.net.
 
 
 


Old
  Post #2 (permalink)   03-15-2004, 08:11 AM
HD Wizard
 
Join Date: Jul 2003
Posts: 2,100

Status: BlackStorm is offline
The only windows/app/exe code I can do is Delphi
Releasing a program today which was coded in Delphi actually

I have never looked at the source for a OS, mainly because I wouldnt understand other languages totally, some is simlar to delphi in ways though
 
 
 


Old
  Post #3 (permalink)   03-15-2004, 08:17 AM
HD Wizard
 
Join Date: Aug 2003
Posts: 1,003

Status: gooooogle is offline
Delphi uses the Pascal programming language does it not?

What program did you release?

If you know pascal this might be of interest
http://compilers.iecc.com/crenshaw/?the_id=64
Tells you how to build you're own compiler in Turbo Pascal.
 
 
 


Old
  Post #4 (permalink)   03-15-2004, 08:44 AM
HD Wizard
 
Join Date: Jul 2003
Posts: 2,100

Status: BlackStorm is offline
Yeah it uses pascal
Just released www.billvoice.com a few minutes ago
Will take a good while for it to get going I think, especially since this is the first beta.

I hate reading anything more than 2 pages long on the net so that guide would kill me hehe
 
 
 


Old
  Post #5 (permalink)   03-15-2004, 08:56 AM
HD Wizard
 
Join Date: Aug 2003
Posts: 1,003

Status: gooooogle is offline
If you also made hostingrefuge.com the forum for billvoice you will have one less forum to manage and people using the program might start posting under other topics as well.

Just a thought.
 
 
 


Old
  Post #6 (permalink)   03-17-2004, 05:02 AM
Leo
HD Amateur
 
Join Date: Mar 2004
Posts: 64

Status: Leo is offline
If its a commercial program I dont think that would be a good idea to mix it with here.
I think it would also add too many forums onto HostingRefuge.com if all forums from that forum on that site are added here.

Do you code gooooogle?
 
 
 


Old
  Post #7 (permalink)   03-17-2004, 07:17 AM
HD Wizard
 
Join Date: Aug 2003
Posts: 1,003

Status: gooooogle is offline
I'm learning to code. Currently looking at C ANSI and Python. But I'm c**p. The code above is from a web page I found.
 
 
 


Old
  Post #8 (permalink)   03-17-2004, 07:43 AM
HD Master
 
Join Date: Feb 2004
Posts: 253

Status: imported_Stephen is offline
Quote:
Currently looking at C ANSI and Python
Whats C ANSI?

What kind ofthings can you do using Python?
I have heard about it but never seen any code and dont know anything about it
 
 
 


Old
  Post #9 (permalink)   03-17-2004, 01:08 PM
HD Addict
 
Join Date: Jan 2004
Location: Edinburgh , Scotland
Posts: 190
Send a message via AIM to Decker

Status: Decker is offline
Ah Assembly code, you made an old man happy :bow:

I came across an OS on one floppy a while ago, full blown GUI the lot - including a browser and mail client

I'll have to look that one out again - last time I tried it was on an old P1 166 laptop and it ran fine, wonder what it would do on my systems now :p
 
 
 


Old
  Post #10 (permalink)   03-17-2004, 01:22 PM
HD Wizard
 
Join Date: Aug 2003
Posts: 1,003

Status: gooooogle is offline
Quote:
Originally posted by Stephen
Whats C ANSI?

What kind ofthings can you do using Python?
I have heard about it but never seen any code and dont know anything about it
ANSI C is basicly C code that meets the requiremants of the ANSI standard. So in short it's normal everyday C.

Python is a programming language which is usually run through an interpreter. The language is very logic. A hello world program would be

Quote:
PRINT "Hello World"
while in ANSI C this would be

Quote:
#include <stdio.h>
main()
{
printf("Hello World/n");
}
 
 
 
Reply

Thread Tools

New Post New Post   Old Post Old Post
Posting Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Sponsored By: