Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #8373 > unrolled thread
| Started by | Ilias Abrams <iliasabrams@gmail.com> |
|---|---|
| First post | 2018-02-26 14:07 -0800 |
| Last post | 2018-02-28 14:03 -0800 |
| Articles | 3 — 3 participants |
Back to article view | Back to comp.programming
How Physical Memory Mapping / Allocation works Ilias Abrams <iliasabrams@gmail.com> - 2018-02-26 14:07 -0800
Re: How Physical Memory Mapping / Allocation works "Ant" <not@home.today> - 2018-02-26 23:04 +0000
Re: How Physical Memory Mapping / Allocation works Ed Prochak <edprochak@gmail.com> - 2018-02-28 14:03 -0800
| From | Ilias Abrams <iliasabrams@gmail.com> |
|---|---|
| Date | 2018-02-26 14:07 -0800 |
| Subject | How Physical Memory Mapping / Allocation works |
| Message-ID | <d6d4eb53-f2b1-41c3-b6d1-4be6a142be05@googlegroups.com> |
Hi guys, I am new on software programming and I am trying to understand some basic/ important things. I am interested in Bare-metal software programming, so please give me answers related on this. My question is: who is responsible and manage the physical memory mapping / allocation? Meaning, If I have 1GB physical memory on my system, the 1) CPU or 2) the Bootloader (like GRUB, U-boot) is responsible for the memory addresses that I can use for my program? Is hardware specific architecture? Each platform manufacture has their own memory address mapping scheme and layout? Furthermore, is there any standart way that you have to partition the physical memory? meaning, give some memory for I/Oports and so on? Sorry for the mess, but I dont understand when you create/ build your software, how you know what range of physical addresses you can use for start/entry point, stack and so on. Please help me to clear all this in my mind. If you can give me examples will help me more P.S. Programming in C Thanks
[toc] | [next] | [standalone]
| From | "Ant" <not@home.today> |
|---|---|
| Date | 2018-02-26 23:04 +0000 |
| Message-ID | <p723t7$1dd4$1@gioia.aioe.org> |
| In reply to | #8373 |
"Ilias Abrams" wrote: >I am new on software programming and I am trying to understand some >basic/ important things. I am interested in Bare-metal software >programming, Do you mean with no operating system (OS)? >so please give me answers related on this. My question >is: who is responsible and manage the physical memory mapping / >allocation? Meaning, If I have 1GB physical memory on my system, the >1) CPU or 2) the Bootloader (like GRUB, U-boot) is responsible for >the memory addresses that I can use for my program? The OS. Without an OS - you are responsible. >Is hardware >specific architecture? Each platform manufacture has their own memory >address mapping scheme and layout? Furthermore, is there any standart >way that you have to partition the physical memory? meaning, give some >memory for I/Oports and so on? The OS takes care of mapping physical memory to virtual memory, otherwise it's hardware dependant. >Sorry for the mess, but I dont understand when you create/ build your >software, how you know what range of physical addresses you can use >for start/entry point, stack and so on. You don't use physical memory. You request virtual memory from the OS via the appropriate interface (usually malloc if using C). >Please help me to clear all this in my mind. If you can give me >examples will help me more P.S. Programming in C Are you writing an OS kernel or user software? If you are writing a kernel you will need to understand the hardware and will have to write some code in the assembler language for your chosen platform. If writing user code, things like stack and I/O space are taken care of automatically by the OS.
[toc] | [prev] | [next] | [standalone]
| From | Ed Prochak <edprochak@gmail.com> |
|---|---|
| Date | 2018-02-28 14:03 -0800 |
| Message-ID | <a502970c-5839-42d7-a6b6-8d97f774a3cf@googlegroups.com> |
| In reply to | #8373 |
On Monday, February 26, 2018 at 5:07:50 PM UTC-5, Ilias Abrams wrote: > Hi guys, > > I am new on software programming and I am trying to understand some basic/ important things. I am interested in Bare-metal software programming, so please give me answers related on this. My question is: who is responsible and manage the physical memory mapping / allocation? Meaning, If I have 1GB physical memory on my system, the 1) CPU or 2) the Bootloader (like GRUB, U-boot) is responsible for the memory addresses that I can use for my program? > Is hardware specific architecture? Each platform manufacture has their own memory address mapping scheme and layout? > Furthermore, is there any standart way that you have to partition the physical memory? meaning, give some memory for I/Oports and so on? > > Sorry for the mess, but I dont understand when you create/ build your software, how you know what range of physical addresses you can use for start/entry point, stack > and so on. > > Please help me to clear all this in my mind. If you can give me examples will help me more > P.S. Programming in C > > Thanks If you want an idea of the bare metal programming, you might find it useful to look at the LINUX source code. For a particular motherboard, you will have to get the information from the manufacturer. And then you may still have to research the (Intel/AMD) chip maker's data and programming documentation for the chipset used on that motherboard. And of course you should research the BIOS services provided by the motherboard. Not an easy task but others have done it. (I haven't worked at that level for many years. Oh, one last suggestion. Ask again in comp.arch.embedded There are some really good developers there that work regularly at this low level. HTH, Ed
[toc] | [prev] | [standalone]
Back to top | Article view | comp.programming
csiph-web