Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Simple Question about Computer Startup

Status
Not open for further replies.

Integrated

Member level 1
Joined
Jul 10, 2003
Messages
39
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
338
Hi,

:( I am confused about starting up a microprosessor. :cry:

I have used 8051 with an external ROM and RAM, There I understood
what was happening ,that was easy , for example we could write MOVX instruction to ROM and there wouldn't be any conflict with RAM at executing from ROM.

But there we didn't put any program in the RAM

I want to know how Pentium (PC computers) put program in RAM and if
RAM means Data how does micro fetches it as Instruction?or does not?


sorry for asking such basic question here but it was about interfacing micro to computer so I suppose PCI slots to send and load my program to the PowerPC microprocessor board's RAM after a simple waiting sturtup code have put in ROM on board. :oops:

Regards. :?:
 

mr_ghz

Full Member level 5
Joined
Apr 1, 2002
Messages
289
Helped
7
Reputation
14
Reaction score
5
Trophy points
1,298
Activity points
3,551
Hi arsadri

Time has changed... No really: the 80C51 has separate spaces for code and data storage. Code memory is addressed using the PSEN signal and data is accessed using RD/WR signals. So you can use the full 16bit address space twice, once for code and once for data. You could not 'execute' data as long as you didn't a special decoding between PSEN and RD.
In a x86 based PC system (and also in a PowerPC) you have no separate code and data memory (only the IO-space is separated, but this is another thing). So theoretically you can store data that represents a valid opcode and make a jump on this space and execute your 'data'. So it's possible to create self-changing code. The proble is what is data and what is code? - This has to be defined in your application/your compiler!
So if you want to use the PCI-bus to write in a PowerPC memory you can do this with simple data move commands. I would suggest that you use a PCI bridge chip (there are many manufacturers), this will be much easier for you.

Bye
 

james

Member level 2
Joined
Sep 14, 2003
Messages
49
Helped
6
Reputation
12
Reaction score
4
Trophy points
1,288
Activity points
1,883
While a PCI bridge chip is certainly the best solution to inteface an embedded micro board to PC using PCI bus, I must disagree a little from last definition given above on how 8051 manages memory.

Although is true that 8051 cores may handle code and data storage in two separated memory space (using PSEN as an additional address bit), this is not the only memory mode. Another one, known as von Neumann mode, can be used. In such of mode the data and code spaces share the same memory space, though in such way only 64k of data/code may be used for 8051. Von Neaumann mode may be entered simply ANDing PSEN with $RD.

Apart from the obvious architecture differences, 8051 (in von Neumann mode) and Pentium will manage ram memory in a similar fashon.

To store code in ram (your application) with built-in data, both makes use of a loader (called bootstrap loader, or bios in PCs) which resides usually on Flash (or Eprom) and launched at power-on or reset or whatever condition which is capable to start up the loader. Once the loader has started it comes to wait for your application using any sort of media or device or interface. It is the loader which is managing it. So, you can use hardisk, PCI bus, or RS232 to load your application in ram memory.

Once your application is in ram it makes not difference from processor if code or data may be fetched in ram rather then rom. 8051 in von Newmann mode will still use MOVC during an instruction fetch and MOVX when a data handle is required from the same external ram memory space. The described mode is usually used in In System Debugger boards.

Above is just for completeness.
 

Integrated

Member level 1
Joined
Jul 10, 2003
Messages
39
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
338
Thanks a lot and help more please,

:) As you mentioned, mr_ghz, It depends on my application/compiler.

8O What do you mean of this, I suppose it to be a method in data decoding,

for example if from 32 bits data, the last bit was 1 thoes other bits will
stand for data,otherwise, for code.

:roll: or something else , for example we have to put code (which has come from PCI) just in the addresses with the last bit 1(so half of the RAM will be for code) , But I don't understand how do we recognize the code from data which are coming. Sorry for this big load of questions.I know,

:oops: Would you mind please introducing me a site or any document for these Computer Architecture questions.

Thanks a lot with regards, ARSadri
 

artem

Advanced Member level 4
Joined
May 22, 2003
Messages
1,350
Helped
126
Reputation
252
Reaction score
32
Trophy points
1,328
Location
Turkey
Activity points
13,461
When you are talking about "ANDing PSEN with $RD" could this lead to problems when using compiler ? How we cacn instruct compiler that code and data have mixed ?
 

mr_ghz

Full Member level 5
Joined
Apr 1, 2002
Messages
289
Helped
7
Reputation
14
Reaction score
5
Trophy points
1,298
Activity points
3,551
Hi artem

The wiring PSEN with RD as mentioned by kowax (and already meant by my phrase 'special decoding') is very often used. In a compiler you always have to define sections for code and sections for data. If both memory areas are physical the same, you have to separate them in address range.
Example: Code from 0x0000 .. 0x7fff, Data from 0x8000 .. 0xffff
Look in startup-files of your compiler (Keil, ..) mostly this is made there.

Hi arsadri

Only by looking at the memory-content you can NOT say if it's code or if it's data! There is no bit that specify this. As explained above, you have to make your own 'memory management' and put data and code in separated areas. Look at the example above: The PC sees a memory array of 64kBytes size. If you write to the lower 32K, this is interpreted as Code, a write to the upper 32K is interpreted as data.

Bye
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top