Added tools and experiments
This commit is contained in:
106
exp/Memory manager/.cproject
Normal file
106
exp/Memory manager/.cproject
Normal file
@ -0,0 +1,106 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?>
|
||||
|
||||
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="cdt.managedbuild.config.gnu.cygwin.exe.debug.115724913">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cygwin.exe.debug.115724913" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.Cygwin_PE" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cygwin.exe.debug.115724913" name="Debug" parent="cdt.managedbuild.config.gnu.cygwin.exe.debug">
|
||||
<folderInfo id="cdt.managedbuild.config.gnu.cygwin.exe.debug.115724913." name="/" resourcePath="">
|
||||
<toolChain id="cdt.managedbuild.toolchain.gnu.cygwin.exe.debug.892886753" name="Cygwin GCC" superClass="cdt.managedbuild.toolchain.gnu.cygwin.exe.debug">
|
||||
<targetPlatform id="cdt.managedbuild.target.gnu.platform.cygwin.exe.debug.1849742475" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.cygwin.exe.debug"/>
|
||||
<builder buildPath="${workspace_loc:/Memory manager/Debug}" id="cdt.managedbuild.target.gnu.builder.cygwin.exe.debug.1722793380" managedBuildOn="true" name="Gnu Make Builder.Debug" superClass="cdt.managedbuild.target.gnu.builder.cygwin.exe.debug"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.assembler.cygwin.exe.debug.1180607088" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.cygwin.exe.debug">
|
||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.550473301" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.archiver.cygwin.base.221799311" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.cygwin.base"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.debug.1459581613" name="Cygwin C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.debug">
|
||||
<option id="gnu.cpp.compiler.cygwin.exe.debug.option.optimization.level.318845190" superClass="gnu.cpp.compiler.cygwin.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
|
||||
<option id="gnu.cpp.compiler.cygwin.exe.debug.option.debugging.level.1044717468" superClass="gnu.cpp.compiler.cygwin.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.debug.1804661896" name="Cygwin C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.debug">
|
||||
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.cygwin.exe.debug.option.optimization.level.249174650" superClass="gnu.c.compiler.cygwin.exe.debug.option.optimization.level" valueType="enumerated"/>
|
||||
<option id="gnu.c.compiler.cygwin.exe.debug.option.debugging.level.2100439600" superClass="gnu.c.compiler.cygwin.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.544290283" superClass="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin"/>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.c.linker.cygwin.exe.debug.1207537489" name="Cygwin C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.cygwin.exe.debug">
|
||||
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1366767681" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||
</inputType>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.exe.debug.981090290" name="Cygwin C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.exe.debug"/>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
<cconfiguration id="cdt.managedbuild.config.gnu.cygwin.exe.release.1614407804">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cygwin.exe.release.1614407804" moduleId="org.eclipse.cdt.core.settings" name="Release">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.Cygwin_PE" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cygwin.exe.release.1614407804" name="Release" parent="cdt.managedbuild.config.gnu.cygwin.exe.release">
|
||||
<folderInfo id="cdt.managedbuild.config.gnu.cygwin.exe.release.1614407804." name="/" resourcePath="">
|
||||
<toolChain id="cdt.managedbuild.toolchain.gnu.cygwin.exe.release.1117383569" name="Cygwin GCC" superClass="cdt.managedbuild.toolchain.gnu.cygwin.exe.release">
|
||||
<targetPlatform id="cdt.managedbuild.target.gnu.platform.cygwin.exe.release.1496680917" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.cygwin.exe.release"/>
|
||||
<builder buildPath="${workspace_loc:/Memory manager/Release}" id="cdt.managedbuild.target.gnu.builder.cygwin.exe.release.512812119" managedBuildOn="true" name="Gnu Make Builder.Release" superClass="cdt.managedbuild.target.gnu.builder.cygwin.exe.release"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.assembler.cygwin.exe.release.950327113" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.cygwin.exe.release">
|
||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1102338020" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.archiver.cygwin.base.1507550678" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.cygwin.base"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.release.1039422280" name="Cygwin C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.release">
|
||||
<option id="gnu.cpp.compiler.cygwin.exe.release.option.optimization.level.2005443698" superClass="gnu.cpp.compiler.cygwin.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
|
||||
<option id="gnu.cpp.compiler.cygwin.exe.release.option.debugging.level.1303203798" superClass="gnu.cpp.compiler.cygwin.exe.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.release.1043628071" name="Cygwin C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.release">
|
||||
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.cygwin.exe.release.option.optimization.level.1310015612" superClass="gnu.c.compiler.cygwin.exe.release.option.optimization.level" valueType="enumerated"/>
|
||||
<option id="gnu.c.compiler.cygwin.exe.release.option.debugging.level.1946912749" superClass="gnu.c.compiler.cygwin.exe.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.1717193404" superClass="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin"/>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.c.linker.cygwin.exe.release.544314131" name="Cygwin C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.cygwin.exe.release">
|
||||
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1556032386" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||
</inputType>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.exe.release.838465677" name="Cygwin C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.exe.release"/>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="Memory manager.cdt.managedbuild.target.gnu.cygwin.exe.1209943794" name="Executable" projectType="cdt.managedbuild.target.gnu.cygwin.exe"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="scannerConfiguration">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cygwin.exe.debug.115724913;cdt.managedbuild.config.gnu.cygwin.exe.debug.115724913.;cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.debug.1804661896;cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.544290283">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"/>
|
||||
</scannerConfigBuildInfo>
|
||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cygwin.exe.release.1614407804;cdt.managedbuild.config.gnu.cygwin.exe.release.1614407804.;cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.release.1043628071;cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.1717193404">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"/>
|
||||
</scannerConfigBuildInfo>
|
||||
</storageModule>
|
||||
</cproject>
|
BIN
exp/Memory manager/Debug/Memory manager.exe
Normal file
BIN
exp/Memory manager/Debug/Memory manager.exe
Normal file
Binary file not shown.
3
exp/Memory manager/Debug/main.d
Normal file
3
exp/Memory manager/Debug/main.d
Normal file
@ -0,0 +1,3 @@
|
||||
main.d main.o: ../main.c ../mem.h
|
||||
|
||||
../mem.h:
|
BIN
exp/Memory manager/Debug/main.o
Normal file
BIN
exp/Memory manager/Debug/main.o
Normal file
Binary file not shown.
43
exp/Memory manager/Debug/makefile
Normal file
43
exp/Memory manager/Debug/makefile
Normal file
@ -0,0 +1,43 @@
|
||||
################################################################################
|
||||
# Automatically-generated file. Do not edit!
|
||||
################################################################################
|
||||
|
||||
-include ../makefile.init
|
||||
|
||||
RM := rm -rf
|
||||
|
||||
# All of the sources participating in the build are defined here
|
||||
-include sources.mk
|
||||
-include subdir.mk
|
||||
-include objects.mk
|
||||
|
||||
ifneq ($(MAKECMDGOALS),clean)
|
||||
ifneq ($(strip $(C_DEPS)),)
|
||||
-include $(C_DEPS)
|
||||
endif
|
||||
endif
|
||||
|
||||
-include ../makefile.defs
|
||||
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
|
||||
# All Target
|
||||
all: Memory\ manager.exe
|
||||
|
||||
# Tool invocations
|
||||
Memory\ manager.exe: $(OBJS) $(USER_OBJS)
|
||||
@echo 'Building target: $@'
|
||||
@echo 'Invoking: Cygwin C Linker'
|
||||
gcc -o "Memory manager.exe" $(OBJS) $(USER_OBJS) $(LIBS)
|
||||
@echo 'Finished building target: $@'
|
||||
@echo ' '
|
||||
|
||||
# Other Targets
|
||||
clean:
|
||||
-$(RM) $(OBJS)$(C_DEPS)$(EXECUTABLES) "Memory manager.exe"
|
||||
-@echo ' '
|
||||
|
||||
.PHONY: all clean dependents
|
||||
.SECONDARY:
|
||||
|
||||
-include ../makefile.targets
|
3
exp/Memory manager/Debug/memory.d
Normal file
3
exp/Memory manager/Debug/memory.d
Normal file
@ -0,0 +1,3 @@
|
||||
memory.d memory.o: ../memory.c ../mem.h
|
||||
|
||||
../mem.h:
|
BIN
exp/Memory manager/Debug/memory.o
Normal file
BIN
exp/Memory manager/Debug/memory.o
Normal file
Binary file not shown.
8
exp/Memory manager/Debug/objects.mk
Normal file
8
exp/Memory manager/Debug/objects.mk
Normal file
@ -0,0 +1,8 @@
|
||||
################################################################################
|
||||
# Automatically-generated file. Do not edit!
|
||||
################################################################################
|
||||
|
||||
USER_OBJS :=
|
||||
|
||||
LIBS :=
|
||||
|
17
exp/Memory manager/Debug/sources.mk
Normal file
17
exp/Memory manager/Debug/sources.mk
Normal file
@ -0,0 +1,17 @@
|
||||
################################################################################
|
||||
# Automatically-generated file. Do not edit!
|
||||
################################################################################
|
||||
|
||||
O_SRCS :=
|
||||
C_SRCS :=
|
||||
S_UPPER_SRCS :=
|
||||
OBJ_SRCS :=
|
||||
ASM_SRCS :=
|
||||
OBJS :=
|
||||
C_DEPS :=
|
||||
EXECUTABLES :=
|
||||
|
||||
# Every subdirectory with source files must be described here
|
||||
SUBDIRS := \
|
||||
. \
|
||||
|
27
exp/Memory manager/Debug/subdir.mk
Normal file
27
exp/Memory manager/Debug/subdir.mk
Normal file
@ -0,0 +1,27 @@
|
||||
################################################################################
|
||||
# Automatically-generated file. Do not edit!
|
||||
################################################################################
|
||||
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
C_SRCS += \
|
||||
../main.c \
|
||||
../memory.c
|
||||
|
||||
OBJS += \
|
||||
./main.o \
|
||||
./memory.o
|
||||
|
||||
C_DEPS += \
|
||||
./main.d \
|
||||
./memory.d
|
||||
|
||||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
%.o: ../%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: Cygwin C Compiler'
|
||||
gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
12
exp/Memory manager/Memory manager.exe.stackdump
Normal file
12
exp/Memory manager/Memory manager.exe.stackdump
Normal file
@ -0,0 +1,12 @@
|
||||
Exception: STATUS_ACCESS_VIOLATION at eip=004016B3
|
||||
eax=00A01CB0 ebx=009A0000 ecx=00403100 edx=FFF9E34C esi=00A01CAA edi=00000000
|
||||
ebp=0022CB18 esp=0022CAF0 program=C:\Users\Tiberiu\workspace\osdev\Memory manager\Debug\Memory manager.exe, pid 5948, thread main
|
||||
cs=001B ds=0023 es=0023 fs=003B gs=0000 ss=0023
|
||||
Stack trace:
|
||||
Frame Function Args
|
||||
0022CB18 004016B3 (00000050, 00403100, 0000000A, 6112C040)
|
||||
0022CB38 00401376 (00000002, 0022CB60, 00000000, 00000000)
|
||||
0022CCA8 00401259 (00403100, 00001000, 00000000, 00401415)
|
||||
0022CCD8 0040143F (00000001, 009C8608, 009C8508, 00008000)
|
||||
0022CD68 61007038 (00000000, 0022CDA4, 61006980, 7FFDC000)
|
||||
End of stack trace
|
82
exp/Memory manager/PROJEC~1
Normal file
82
exp/Memory manager/PROJEC~1
Normal file
@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Memory manager</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<triggers>clean,full,incremental,</triggers>
|
||||
<arguments>
|
||||
<dictionary>
|
||||
<key>?name?</key>
|
||||
<value></value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.append_environment</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
|
||||
<value>all</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.buildArguments</key>
|
||||
<value></value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.buildCommand</key>
|
||||
<value>make</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.buildLocation</key>
|
||||
<value>${workspace_loc:/Memory manager/Debug}</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
|
||||
<value>clean</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.contents</key>
|
||||
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
|
||||
<value>false</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
|
||||
<value>all</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.stopOnError</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
33
exp/Memory manager/main.c
Normal file
33
exp/Memory manager/main.c
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* main.c
|
||||
*
|
||||
* Created on: Aug 24, 2011
|
||||
* Author: Tiberiu
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "mem.h"
|
||||
|
||||
void print_memmap()
|
||||
{
|
||||
uint32 i;
|
||||
printf("memory map:\n");
|
||||
for (i = 0; i <= TotalFrames>>5; i++)
|
||||
printf("0x%x ", FrameMap[i]);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
MemPhInitialize(1024);
|
||||
MemPhReserveFrames(0, 0x20000);
|
||||
MemPhReserveFrames(0xF0000, 0x10000);
|
||||
|
||||
// Find a free frame
|
||||
uint32 i;
|
||||
for (i = 0; i < 10; i++) MemPhAllocFrame(0,0);
|
||||
|
||||
return 0;
|
||||
}
|
37
exp/Memory manager/mem.h
Normal file
37
exp/Memory manager/mem.h
Normal file
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* ord-arr.h
|
||||
*
|
||||
* Created on: Aug 24, 2011
|
||||
* Author: Tiberiu
|
||||
*/
|
||||
|
||||
#ifndef ORD_ARR_H_
|
||||
#define ORD_ARR_H_
|
||||
#include <stdio.h>
|
||||
|
||||
typedef unsigned int uint32;
|
||||
typedef unsigned char uint8;
|
||||
|
||||
#define Log(...) { printf(__VA_ARGS__); }
|
||||
#define Error(...) { fprintf(stderr, __VA_ARGS__); }
|
||||
|
||||
#define Panic(...) { printf("[PANIC] Kernel panic: "); printf(__VA_ARGS__); }
|
||||
|
||||
#define LogMem(...) { Log("[MemLog] "); Log(__VA_ARGS__); }
|
||||
#define ErrorMem(...) { Error("[MemErr] "); Error(__VA_ARGS__); }
|
||||
|
||||
extern uint32* FrameMap;
|
||||
extern uint32 TotalFrames;
|
||||
extern uint32 TotalMemory;
|
||||
|
||||
extern void ConvertIndexToFrame (uint32 index, uint32* address, uint32* offset);
|
||||
extern uint32 ConvertFrameToIndex (uint32 address, uint32 offset);
|
||||
|
||||
extern void MemPhSetFrame (uint32 frame, uint8 value);
|
||||
extern uint32 MemPhGetFrame (uint32 frame);
|
||||
extern uint32 MemPhFindFreeFrame();
|
||||
extern void MemPhAllocFrame(uint8 isKernel, uint8 isWriteable);
|
||||
extern void MemPhInitialize(uint32 SystemMemoryKb);
|
||||
extern void MemPhReserveFrames (uint32 address, uint32 length);
|
||||
|
||||
#endif /* ORD_ARR_H_ */
|
102
exp/Memory manager/memory.c
Normal file
102
exp/Memory manager/memory.c
Normal file
@ -0,0 +1,102 @@
|
||||
/*
|
||||
* mem-phys.c
|
||||
*
|
||||
* Created on: Aug 27, 2011
|
||||
* Author: Tiberiu
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "mem.h"
|
||||
|
||||
uint32* FrameMap;
|
||||
uint32 TotalFrames;
|
||||
uint32 TotalMemory;
|
||||
|
||||
void ConvertIndexToFrame (uint32 index, uint32* address, uint32* offset)
|
||||
{
|
||||
*address = (index >> 5);
|
||||
*offset = index & 0x1f;
|
||||
}
|
||||
|
||||
uint32 ConvertFrameToIndex (uint32 address, uint32 offset)
|
||||
{
|
||||
return (address<<5) | offset;
|
||||
}
|
||||
|
||||
void MemPhSetFrame (uint32 frame, uint8 value)
|
||||
{
|
||||
uint32 addr, off;
|
||||
ConvertIndexToFrame(frame, &addr, &off);
|
||||
|
||||
if (value) FrameMap[addr] |= 1<<off;
|
||||
else FrameMap[addr] &= ~(1<<off);
|
||||
}
|
||||
|
||||
uint32 MemPhGetFrame (uint32 frame)
|
||||
{
|
||||
uint32 addr, off;
|
||||
ConvertIndexToFrame(frame, &addr, &off);
|
||||
|
||||
return FrameMap[addr] & (1<<off);
|
||||
}
|
||||
|
||||
uint32 MemPhFindFreeFrame()
|
||||
{
|
||||
uint32 addr, pos;
|
||||
|
||||
for (addr = 0; addr < TotalFrames >> 5; addr++)
|
||||
if (FrameMap[addr] != 0xffffffff)
|
||||
{
|
||||
for (pos = 0; (FrameMap[addr] & (1<<pos)) != 0; pos++) ;
|
||||
|
||||
return ConvertFrameToIndex(addr, pos);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void MemPhAllocFrame(uint8 isKernel, uint8 isWriteable)
|
||||
{
|
||||
//if (page->Frame != 0) return;
|
||||
|
||||
uint32 free = MemPhFindFreeFrame();
|
||||
if (!free) return;
|
||||
|
||||
LogMem("Physical: allocated frame %u.\n", free);
|
||||
|
||||
MemPhSetFrame(free, 1);
|
||||
/*page->Present = 1;
|
||||
page->User = (isKernel) ? 0 : 1;
|
||||
page->Writeable = (isWriteable) ? 1 : 0;
|
||||
page->Frame = free;*/
|
||||
}
|
||||
|
||||
/*void MemPhFreeFrame()//Page* page)
|
||||
{
|
||||
uint32 frame = page->Frame;
|
||||
if (!frame) return;
|
||||
|
||||
MemPhSetFrame(frame, 0);
|
||||
page->Frame = 0;
|
||||
}*/
|
||||
|
||||
void MemPhInitialize(uint32 SystemMemoryKb)
|
||||
{
|
||||
LogMem("Starting physical memory manager...\n");
|
||||
TotalFrames = SystemMemoryKb >> 2;
|
||||
TotalMemory = SystemMemoryKb;
|
||||
|
||||
FrameMap = (uint32*) malloc(sizeof(uint32) * (1 + (TotalFrames>>5)));
|
||||
memset(FrameMap, 0, sizeof(uint32) * (1 + (TotalFrames>>5)));
|
||||
LogMem("Started ok!, found %ukb total_frames=%u\n", SystemMemoryKb, TotalFrames);
|
||||
}
|
||||
|
||||
void MemPhReserveFrames (uint32 address, uint32 length)
|
||||
{
|
||||
address >>= 12;
|
||||
length = (length>>12) + ((length & 0xfff) > 0);
|
||||
uint32 end = address + length;
|
||||
|
||||
for (; address < end && address < TotalFrames ; address++)
|
||||
MemPhSetFrame(address, 1);
|
||||
}
|
Reference in New Issue
Block a user