Page 4 of 4

Re:The batman Tech Os

Posted: Wed Dec 21, 2005 9:22 am
by Bladers
[glow=red,2,300]Interacting With User Interface Code[/glow]

Code: Select all

;----------------------------------------------------------------------
; Interactivity Example Boot Program
;
; Joel Gompert 2001
;
; Disclaimer: I am not responsible for any results of the use of the contents
;   of this file
;----------------------------------------------------------------------
???org 0x7c00???; This is where BIOS loads the bootloader


; Execution begins here
entry:
???jmp short begin ; jump over the DOS boot record data


; ----------------------------------------------------------------------
; data portion of the "DOS BOOT RECORD"
; ----------------------------------------------------------------------
brINT13Flag     DB      90H             ; 0002h - 0EH for INT13 AH=42 READ
brOEM           DB      'MSDOS5.0'      ; 0003h - OEM name & DOS version (8 chars)
brBPS           DW      512             ; 000Bh - Bytes/sector
brSPC           DB      1               ; 000Dh - Sectors/cluster
brResCount      DW      1               ; 000Eh - Reserved (boot) sectors
brFATs          DB      2               ; 0010h - FAT copies
brRootEntries   DW      0E0H??????; 0011h - Root directory entries
brSectorCount   DW      2880??????; 0013h - Sectors in volume, < 32MB
brMedia         DB      240??????; 0015h - Media descriptor
brSPF           DW      9               ; 0016h - Sectors per FAT
brSPH           DW      18              ; 0018h - Sectors per track
brHPC           DW      2??????; 001Ah - Number of Heads
brHidden        DD      0               ; 001Ch - Hidden sectors
brSectors       DD      0???        ; 0020h - Total number of sectors
??????DB      0               ; 0024h - Physical drive no.
??????DB      0               ; 0025h - Reserved (FAT32)
??????DB      29H             ; 0026h - Extended boot record sig 
brSerialNum     DD      404418EAH       ; 0027h - Volume serial number (random)
brLabel         DB      'Joels disk '   ; 002Bh - Volume label  (11 chars)
brFSID          DB      'FAT12   '      ; 0036h - File System ID (8 chars)
;------------------------------------------------------------------------


; --------------------------------------------
;  Boot program code begins here
; --------------------------------------------
; boot code begins at 0x003E
begin:
???xor???ax, ax??????; zero out ax
???mov???ds, ax??????; set data segment to base of RAM
???mov???si, msg??????; load address of our message
???call???putstr??????; print the message

loop1:
???xor???ah, ah??????; function 0
???int???0x16??????; get a key from the keyboard

???mov???si, charmsg???; load address of message
???call???putstr??????; print the message

???mov???ah, 0x0e???; function print character
???mov???bl, 0x07???; white on black
???int???0x10

???mov???si, newline???; print a newline
???call???putstr

???jmp???loop1??????; just loop forever.

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

msg???db???'Press a key.'
newline db???13,10,0
charmsg db???'Character: ',0

; ---------------------------------------------
; Print a null-terminated string on the screen
; ---------------------------------------------
putstr:
???push???ax

putstrl:
???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, 0x0007???; color
???int???0x10
        jmp???repeat
Repeat:
msg???db???'Press a key.'
jmp???putstrl

putstrd:
???pop???ax
???retn
;---------------------------------------------

size???equ???$ - entry
%if size+2 > 512
  %error "code is too large for boot sector"
%endif
???times???(512 - size - 2) db 0

???db???0x55, 0xAA??????;2  byte boot signature

Re:The batman Tech Os

Posted: Wed Dec 21, 2005 11:57 am
by DennisCGc
Hi 'Bladers',
Bladers wrote: Code snippet....
You know that this doesn't run on a PDA, do you? Do you actually know what every (in this source instructed) instruction means? (Be honest). And, why did you actually post that?

Seriously, if you want to create your 'Bat wave', you should at least know how a PDA actually works. (howstuffworks.com doesn't give you that..) I mean, what CPU, how does it boot, etc.? I can't say you're helping the others to find out your problem. Just collect as much info as you can and try to find the best (for you) way.

I don't mean this in a negative way, but you at least could've done more research. Yeah, it's nice you have an idea in your head, which you want to realize. But putting zero effort in your idea really doesn't help. (It's like a child, you have to take care of it, you can't give it birth and let him to take care of him/herself.)

The only advice I could give is to seriously think 'bout it: do you want to put that much effort in transforming a PDA? (eg. creating your own OS, which is one of the most complex things) Or could you walk another path and programming a microchip or programming a program for your pda? :)

A few questions though:

Have you any Linux/Unix/*BSD/DOS experience? (I however don't seem to notice that) Do you actually read the other members' advice? And last, is there a way to express yourself more readable? (punctuation, grammar, spelling, etc.) Yeah, I know, my English sucks.. but somehow I can make myself clear..

Best regards and good luck with your project,

DennisCGc.

Re:The batman Tech Os

Posted: Wed Dec 21, 2005 12:16 pm
by Kemp
DennisCGc: Compared to this guy's english yours is perfect ;) To be honest, I didn't notice anything wrong with yours in that post (and I don't remember your other posts being bad).

Bladers: Yes, that is assembly code, what's your point?

Re:The batman Tech Os

Posted: Thu Dec 22, 2005 4:02 am
by Candy
The entirely off-topic discussion of language, style and moderation has been moved to this thread.

to Bladers: your question about newos.org compilation was forked to its own thread, just in case ...