operating-system

What Can Cause a C Program to Crash Operating System

核能气质少年 提交于 2021-02-19 03:47:31
问题 I recently found that a fairly large image manipulation program I'm writing in C on a Windows 8 machine has a bug when used in very particular circumstances. Unfortunately, the bug is causing my entire computer to come to a standstill so that my only option is to pull the plug on the computer (especially annoying when I'm working remotely...) Because it's an image manipulation program, I can't just flood it with print statements to isolate the problematic section - the problem occurs

what is the Java equivalent of Pythons's subprocess shell=True property?

大憨熊 提交于 2021-02-16 15:02:21
问题 I've been using python for a long time. python's system and subprocess methods can take shell=True attibute to spawn an intermediate process setting up env vars. before the command runs. I've be using Java back and forth and using Runtime.exec() to execute shell command. Runtime rt = Runtime.getRuntime(); Process process; String line; try { process = rt.exec(command); process.waitFor(); int exitStatus = process.exitValue(); } I find difficulty to run some commands in java with success like

Undefined reference to in os kernel linking

不羁岁月 提交于 2021-02-11 05:00:58
问题 i have a problem. I making simple OS kernel with this tutorial: http://wiki.osdev.org/Bare_Bones#Linking_the_Kernel but,if i want to link files boot.o and kernel.o, gcc compiler returns this error: boot.o: In function `start': boot.asm:(.text+0x6): undefined reference to `kernel_main' collect2.exe: error: ld returned 1 exit status. sources of files: boot.asm ; Declare constants used for creating a multiboot header. MBALIGN equ 1<<0 ; align loaded modules on page boundaries MEMINFO equ 1<<1 ;

Undefined reference to in os kernel linking

拈花ヽ惹草 提交于 2021-02-11 04:57:23
问题 i have a problem. I making simple OS kernel with this tutorial: http://wiki.osdev.org/Bare_Bones#Linking_the_Kernel but,if i want to link files boot.o and kernel.o, gcc compiler returns this error: boot.o: In function `start': boot.asm:(.text+0x6): undefined reference to `kernel_main' collect2.exe: error: ld returned 1 exit status. sources of files: boot.asm ; Declare constants used for creating a multiboot header. MBALIGN equ 1<<0 ; align loaded modules on page boundaries MEMINFO equ 1<<1 ;

Where is the Linear Address Space located?

拈花ヽ惹草 提交于 2021-02-10 15:10:58
问题 I'm reading the intel manual, and I see mentions of "Linear Address Space of the processor". I'm confused as to where or what the linear address space actually is. Where in the processor is the linear address space? The Physical Address Space is the actual RAM as I understand. A logical address is a "segment selector" + "offset", and it must be translated to a physical address. If I understand, if paging is not used, the linear address space is effectively the same as a physical address in

Where is the Linear Address Space located?

孤人 提交于 2021-02-10 15:05:59
问题 I'm reading the intel manual, and I see mentions of "Linear Address Space of the processor". I'm confused as to where or what the linear address space actually is. Where in the processor is the linear address space? The Physical Address Space is the actual RAM as I understand. A logical address is a "segment selector" + "offset", and it must be translated to a physical address. If I understand, if paging is not used, the linear address space is effectively the same as a physical address in

How do I call hex data stored in an array with inline assembly?

你。 提交于 2021-02-10 11:56:32
问题 I have an OS project that I am working on and I am trying to call data that I have read from the disk in C with inline assembly. I have already tried reading the code and executing it with the assembly call instruction, using inline assembly. void driveLoop() { uint16_t sectors = 31; uint16_t sector = 0; uint16_t basesector = 40000; uint32_t i = 40031; uint16_t code[sectors][256]; int x = 0; while(x==0) { read(i); for (int p=0; p < 256; p++) { if (readOut[p] == 0) { } else { x = 1; //kprint

How do I call hex data stored in an array with inline assembly?

[亡魂溺海] 提交于 2021-02-10 11:55:11
问题 I have an OS project that I am working on and I am trying to call data that I have read from the disk in C with inline assembly. I have already tried reading the code and executing it with the assembly call instruction, using inline assembly. void driveLoop() { uint16_t sectors = 31; uint16_t sector = 0; uint16_t basesector = 40000; uint32_t i = 40031; uint16_t code[sectors][256]; int x = 0; while(x==0) { read(i); for (int p=0; p < 256; p++) { if (readOut[p] == 0) { } else { x = 1; //kprint

Sharing kernel of the host operating system while using Docker

和自甴很熟 提交于 2021-02-10 06:40:14
问题 If I deploy an image built by choosing Alpine Linux as the base image on my Ubuntu machine (which acts as the host OS - where Docker is installed), will there be two kernels at play here - one from Ubuntu and another one from Alpine? I read that Docker containers will share the host Kernel, so I'm bit confused here. If I login to a running container and issue another command, will this be another process from the perspective of the host OS? Or will this be another thread? From the perspective

How do Operating Systems prevent programs from accessing memory?

心已入冬 提交于 2021-02-08 19:16:17
问题 My understanding currently is, I can write an operating system in C I can write a program for that operating system in C When I write an operating system I can see all of the memory When I write a program the operating system hides memory from other programs from me. Whenever a program runs inside an OS it appears to the program as if the memory it is allocated is all the memory the computer has How does the CPU / OS achieve this? Is this something purely implemented on the software level? Or