low-level

How to map two virtual adresses on the same physical memory on linux?

拥有回忆 提交于 2019-12-03 14:17:42
I'm facing a quite tricky problem. I'm trying to get 2 virtual memory areas pointing to the same physical memory. The point is to have different page protection parameters on different memory areas. On this forum, the user seems to have a solution, but it seems kinda hacky and it's pretty clear that something better can be done performance-wise : http://www.linuxforums.org/forum/programming-scripting/19491-map-two-virtual-memory-addres-same-physical-page.html As I'm facing the same problem, I want to give a shot here to know if somebody has a better idea. Don't be afraid to mention the dirty

How to view the disassembly in Code::Blocks?

时间秒杀一切 提交于 2019-12-03 13:18:19
I read this article about some low level underpinnings of C/C++, and the author is basically showing us through the assembly code generated by the compiler, line by line. He is using VS 2010, but I don't, I use Code::Blocks. How do I view the disassembly there? When I go to debugger, and click disassembly, it shows me a blank window... This is the C++ (.cpp) code (the whole code) I compiled: int main() { int x = 1; int y = 2; int z = 0; z = x + y; return 0; } The kind of disassembly that the author shows in the article is called inter-leaved disassembly ( C and disassembly interleaved ) which

Where can I find a reference for what every bit of the CorFlags value means?

可紊 提交于 2019-12-03 11:36:21
I'm messing around with some rather low level things and trying to determine why I get different outputs with the CorFlags.exe utility. For reference, the outputs are as so: $ corflags test2.exe Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 4.0.30319.17929 Copyright (c) Microsoft Corporation. All rights reserved. Version : v4.0.30319 CLR Header: 2.5 PE : PE32 CorFlags : 0x1 ILONLY : 1 32BITREQ : 0 32BITPREF : 0 Signed : 0 $ corflags test.exe Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 4.0.30319.17929 Copyright (c) Microsoft Corporation. All rights reserved.

How does a memory map of a Windows process look like?

别来无恙 提交于 2019-12-03 06:50:41
问题 This might be a duplicate question. I wish to know how the memory map of a windows process look like? I am looking for details. Kindly provide links to blogs, articles and other relevant literature. 回答1: I always like to actually be able to see things, rather than just read theory. It turns out, according to this blog post, that if you open a program using windbg even when it isn't running it still gets mapped to an address space as if it were. Thus, your disassembly window figuratively (not

What's the point of cache coherency?

心不动则不痛 提交于 2019-12-03 06:38:59
On CPUs like x86, which provide cache coherency, how is this useful from a practical perspective? I understand that the idea is to make memory updates done on one core immediately visible on all other cores. This is a useful property. However, one can't rely too heavily on it if not writing in assembly language, because the compiler can store variable assignments in registers and never write them to memory. This means that one must still take explicit steps to make sure that stuff done in other threads is visible in the current thread. Therefore, from a practical perspective, what has cache

Safer Alternatives to the C Standard Library

ⅰ亾dé卋堺 提交于 2019-12-03 06:29:42
The C standard library is notoriously poor when it comes to I/O safety. Many functions have buffer overflows ( gets , scanf ), or can clobber memory if not given proper arguments ( scanf ), and so on. Every once and awhile, I come across an enterprising hacker who has written his own library that lacks these flaws. What are the best of these libraries you have seen? Have you used them in production code, and if so, which held up as more than hobby projects? kliketa I use GLib library, it has many good standard and non standard functions. See https://developer.gnome.org/glib/stable/ and maybe

I want to create a simple assembler in C. Where should I begin? [duplicate]

两盒软妹~` 提交于 2019-12-03 06:01:07
问题 This question already has answers here : Building an assembler (4 answers) How Do You Make An Assembler? [closed] (4 answers) Closed 6 years ago . I've recently been trying to immerse myself in the world of assembly programming with the eventual goal of creating my own programming language. I want my first real project to be a simple assembler written in C that will be able to assemble a very small portion of the x86 machine language and create a Windows executable. No macros, no linkers.

iPhone iOS4 low-level camera control?

强颜欢笑 提交于 2019-12-03 05:21:49
问题 Is there a way to manually set low-level still-camera settings like shutter speed, aperture, or ISO in iOS4 on the iPhone 4? I don't think it exists in the official SDK but perhaps someone has found some private APIs to allow this? I find my iPhone 4 camera to be unusable because even in fairly decent lighting, it always insists on shooting at the slowest 1/15th a second shutter speed causing motion blur if the subject is moving at all. Thanks! 回答1: Not directly. Please file a bug report. Yes

Assembly - .data, .code, and registers…?

让人想犯罪 __ 提交于 2019-12-03 02:20:18
问题 So this morning I posted a confused question about assembly and I received some great genuine help, which I really appreciate. And now I'm starting to get into assembly and am beginning to understand how it works. Things I feel I understand alright include the stack, interrupts, binary/hex, and in general what most of the basic operations do (jmp, push, mov, etc). Concepts that I'm struggling to understand and would like help with are below - it would be a huge help if you could address any

How are Operating Systems “Made”?

痴心易碎 提交于 2019-12-03 01:43:37
问题 Creating an OS seems like a massive project. How would anyone even get started? For example, when I pop Ubuntu into my drive, how can my computer just run it? (This, I guess, is what I'd really like to know.) Or, looking at it from another angle, what is the least amount of bytes that could be on a disk and still be "run" as an OS? (I'm sorry if this is vague. I just have no idea about this subject, so I can't be very specific. I pretend to know a fair amount about how computers work, but I'm