Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
View Poll Results: IS SNK COOL?
YES 5 83.33%
NO 1 16.67%
??? 0 0%
Voters: 6. You may not vote on this poll

Closed Thread
Old 02-16-2006, 04:21 PM   #11 (permalink)
 
Ultra Techie

Join Date: Jul 2005

Posts: 530

TheHeadFL

Send a message via AIM to TheHeadFL
Default

Assembly code doesn't refer to a specific language. Its just a class of languages that are a human readable version of the underlying binary opcodes.

Different processor architectures have different assembly codes.

X86 assembly is different than PowerPC assembly is different than MIPS assembly etc etc.
__________________
Desktop machine: 2 x Opteron 246, Asus K8N-DL, 2GB PC3200 ECC Reg., XFX GeForce 6600GT, 74gb WD Raptor, 2 x 19\" LCDs, Windows XP x64
Server machine: Intel P4 3.0GHz 2MB EM64T, ECS i865pe, 1GB PC3200, 36gb WD Raptor, Windows Server 2003
Laptop: Dell Inspiron 9100 (Intel P4 3.2GHz 1MB Prescott, i865pe, 512MB PC3200, Mobility Radeon 9700, DVD+R/DL Burner), Windows XP
Linux: P3 450Mhz, 386MB ram, Slackware 10.1 (Running mySQL/Apache)
TheHeadFL is offline  
Old 02-16-2006, 04:25 PM   #12 (permalink)
 
Ultra Techie

Join Date: Jul 2005

Posts: 530

TheHeadFL

Send a message via AIM to TheHeadFL
Default

This is a response I wrote recently to a thread about programming:
Quote:
Originally posted by TheHeadFL
To really write an OS you are going to need to know your processors assembly inside and out.

You're also going to have to be very very good at C.

The true beginning of an OS is basically building a binary image that you can write to a floppy disk (or other bootable media). This binary image basically contains a few lines of assembly that direct the computer to begin loading the rest of the OS (specifically the interrupt handler) from the floppy disk or the hard drive.

Once the interrupt handler is in place in memory, the fence register in the CPU must be set so that user programs cannot overwrite the interrupt handler.

Next, the System Vector Call table (syscall) must be loaded. This would be generally your lowest level functions like console input and output. This would also be basic functions that handle basic disk access. These syscalls are generally written in C with built-in assembly routines. In these cases, the C files must not rely on any standard libraries. All syscalls can only consist of the most basic C language statements, no libraries.

The next step is to pass control over the machine over to whatever higher level layer exists. In most cases, there are many layers between the SVC table, interrupt handler, and the end shell/interface.

If you were writing an OS at this point, you would want to implement your own implementation of the C standard libraries (or download a working source) and get those running on your system.

At this point, you are ready to execute binaries compiled using a high-level language like C and the standard libraries. Generally you only want the OS kernel to run at this level. The kernel then, combined with the interrupt handler, sets up a multi-programming environment. This just means you enable the 'OS' to manage processes and threads, and if neccesary handle multiple processes and context switching.

Once you are this far you would also want to write drivers to wrap the assembly calls (or low level syscalls) that are required to interface with the rest of the system hardware. This includes, but is in no way limited to sound cards, high-resolution video adapters, mouse or keyboard input, and any other essential hardware.

Finally, once this is completely done, you could write a shell or some other interface. This could be as simple as a command line, or you could use your driver layer to render high resolution graphical video. Either way, you are writing the main process by which the user interacts with the OS, including input/output, and launching and managing other processes.

At this level, you've basically got a complete OS. Theoretically you could compile and run user programs at this point.

Of course, what I've described easily encompasses months if not years of work. An OS that implements what I've described could easily be thousands and thousands of lines of code.

__________________
Desktop machine: 2 x Opteron 246, Asus K8N-DL, 2GB PC3200 ECC Reg., XFX GeForce 6600GT, 74gb WD Raptor, 2 x 19\" LCDs, Windows XP x64
Server machine: Intel P4 3.0GHz 2MB EM64T, ECS i865pe, 1GB PC3200, 36gb WD Raptor, Windows Server 2003
Laptop: Dell Inspiron 9100 (Intel P4 3.2GHz 1MB Prescott, i865pe, 512MB PC3200, Mobility Radeon 9700, DVD+R/DL Burner), Windows XP
Linux: P3 450Mhz, 386MB ram, Slackware 10.1 (Running mySQL/Apache)
TheHeadFL is offline  
Old 02-16-2006, 04:48 PM   #13 (permalink)
 
Newb Techie

Join Date: Jan 2006

Posts: 35

cowboyX

Default

anyway. . . . I am not intending to make this OS to be just like windows. . . . . . I need a basic OS that can run on at least my calulator for now. I have a TI83 plus calculator. That has the X86 processor I do believe. as soon as I get the basic OS written I was going to have a driver that runs the extention port, then put some cool devices the run off the port.
cowboyX is offline  
Old 02-16-2006, 05:11 PM   #14 (permalink)
 
Ultra Techie

Join Date: Jul 2005

Posts: 530

TheHeadFL

Send a message via AIM to TheHeadFL
Default

The TI83 does not run any kind of x86 processor.

It would be a custom Texas Instruments processor that is probably a special purpose mathematics processor. It would not be a general purpose processor like the x86.

I don't think you could really call anything that ran on a TI83 calculator an "OS" in any sense of the term. Its more like a shell.
__________________
Desktop machine: 2 x Opteron 246, Asus K8N-DL, 2GB PC3200 ECC Reg., XFX GeForce 6600GT, 74gb WD Raptor, 2 x 19\" LCDs, Windows XP x64
Server machine: Intel P4 3.0GHz 2MB EM64T, ECS i865pe, 1GB PC3200, 36gb WD Raptor, Windows Server 2003
Laptop: Dell Inspiron 9100 (Intel P4 3.2GHz 1MB Prescott, i865pe, 512MB PC3200, Mobility Radeon 9700, DVD+R/DL Burner), Windows XP
Linux: P3 450Mhz, 386MB ram, Slackware 10.1 (Running mySQL/Apache)
TheHeadFL is offline  
Old 02-16-2006, 05:44 PM   #15 (permalink)
 
Newb Techie

Join Date: Jan 2006

Posts: 35

cowboyX

Default

what kind of proccesor does it run than? hmmmmmmmmm smart ***?
cowboyX is offline  
Old 02-16-2006, 06:06 PM   #16 (permalink)
 
Ultra Techie

Join Date: Jul 2005

Posts: 530

TheHeadFL

Send a message via AIM to TheHeadFL
Default

According to the information I found, its a 6MHz Texas Instruments Z80 processor.
__________________
Desktop machine: 2 x Opteron 246, Asus K8N-DL, 2GB PC3200 ECC Reg., XFX GeForce 6600GT, 74gb WD Raptor, 2 x 19\" LCDs, Windows XP x64
Server machine: Intel P4 3.0GHz 2MB EM64T, ECS i865pe, 1GB PC3200, 36gb WD Raptor, Windows Server 2003
Laptop: Dell Inspiron 9100 (Intel P4 3.2GHz 1MB Prescott, i865pe, 512MB PC3200, Mobility Radeon 9700, DVD+R/DL Burner), Windows XP
Linux: P3 450Mhz, 386MB ram, Slackware 10.1 (Running mySQL/Apache)
TheHeadFL is offline  
Old 02-16-2006, 07:11 PM   #17 (permalink)
 
Super Techie

Join Date: May 2005

Posts: 479

furtivefelon

Default

when you list java as one of your potential choice for writing OS, offically you have no idea what your talking about.. try linux, it might do what you want, if not, start hacking away..
__________________
lisp hacker
running: FreeBSD 5.4 - still learning
develop with: SBCL + emacs for lisp, Anjuta IDE +gcc for c, SPE for python..
browse with: opera
furtivefelon is offline  
Old 02-16-2006, 08:19 PM   #18 (permalink)
ATIRAGEPRO's Avatar
 
Monster Techie

Join Date: Mar 2004

Posts: 1,392

ATIRAGEPRO is on a distinguished road

Send a message via AIM to ATIRAGEPRO Send a message via Yahoo to ATIRAGEPRO
Cool "We should be ToUcHiiiiiiiN....."

Quote:
Originally posted by TheHeadFL
Assembly code doesn't refer to a specific language. Its just a class of languages that are a human readable version of the underlying binary opcodes.

Different processor architectures have different assembly codes.

X86 assembly is different than PowerPC assembly is different than MIPS assembly etc etc.
That's true, (I know this already) and like i said before, i wouldn't put native windows upcodes in there if i were making my own OS, just like i wouldn't have native Mac upcodes with a PowerPC. It's a common mistake.

Programming an OS is not nearly as easy as programming a simple program. You have to specify every signal of every pixel on the screen (If you're making GUI) program how to integrate within the video board, Chipset, CPU, Math Coprocessor, keyboard, (As well as any device and port connected to the computer. ) and and most importantly, Recorce fork.

I bet most of you never even heard of that before, but that's just the Mac term for it. (I forgot what it's called with PC :o)It's how CPU's separate files from folders. This is why it takes alot more than just one person to make any OS.


Quote:
when you list java as one of your potential choice for writing OS, offically you have no idea what your talking about.. try linux, it might do what you want, if not, start hacking away..
Like i said....
Java is programming language for Sun Microsystems servers with SPARC Architexture and Sun OS. If he wants to build a SUN computer, there ya go. (Though that's more than likely not going to happen.)
Linux was a good suggestion. Most distrebutions are FREE!


Please let me know when you wan't to start building handheald!
__________________

Quote:
Originally posted by bonehelm
WTF ROFLMAO !!!! WTF OMFG LOL !!!! PARDON THE ****KING CAPS IM SO ROFL NOW !!!

I just found out I\'ve been using direct X 8.1 since its out.
He who knows when enough is enough will always have enough... - Lao Tzu
ATIRAGEPRO is offline  
Old 02-16-2006, 08:31 PM   #19 (permalink)
 
Ultra Techie

Join Date: Jul 2005

Posts: 530

TheHeadFL

Send a message via AIM to TheHeadFL
Default

All x86 processors would use the same assembly, regardless of whether they are Windows, Linux, BSD, or anything else.

The opcodes are the functions that the processor exposes for end user usage.... ADD, SUB, MUL, DIV, MOV, STO, LD, INT, etc.
__________________
Desktop machine: 2 x Opteron 246, Asus K8N-DL, 2GB PC3200 ECC Reg., XFX GeForce 6600GT, 74gb WD Raptor, 2 x 19\" LCDs, Windows XP x64
Server machine: Intel P4 3.0GHz 2MB EM64T, ECS i865pe, 1GB PC3200, 36gb WD Raptor, Windows Server 2003
Laptop: Dell Inspiron 9100 (Intel P4 3.2GHz 1MB Prescott, i865pe, 512MB PC3200, Mobility Radeon 9700, DVD+R/DL Burner), Windows XP
Linux: P3 450Mhz, 386MB ram, Slackware 10.1 (Running mySQL/Apache)
TheHeadFL is offline  
Old 02-16-2006, 08:42 PM   #20 (permalink)
Chankama's Avatar
 
Monster Techie

Join Date: Jan 2005

Location: Canada

Posts: 1,522

Chankama will become famous soon enough

Default

Well to "build" a handheld of your own, you have to make some decisions with regards to the microprocessors, RAM, ROM, etc. you want to use. If you want to 'build" those from scratch, then you have to look into FPGA and learn a HDL like VHDL.

Once you have the h/w, then you can use C/C++ and assembly to code the OS.

Things for you to look up on Wikipedia:
FPGA
VHDL
Microprocessor
Microcontroller
C++
Assembly
RTOS (well you don't need a "real time" OS, but the topic RTOS will talk about the needed elements - e.g. scheduler)

I am sure the other guys will list more stuff
Chankama is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On