FreeNOS
SystemInfo.cpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2009 Niek Linnenbank
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include <FreeNOS/System.h>
19#include <FreeNOS/Config.h>
20#include <FreeNOS/Kernel.h>
21#include <SplitAllocator.h>
22#include <CoreInfo.h>
23
25{
28
29 DEBUG("");
30
31 // Fill in our current information
32 info->version = VERSIONCODE;
33 info->kernelAddress = core->kernel.phys;
34 info->kernelSize = core->kernel.size;
35 info->memorySize = memory->size();
36 info->memoryAvail = memory->available();
37 info->coreId = core->coreId;
38
40 info->bootImageSize = core->bootImageSize;
41 info->timerCounter = core->timerCounter;
43 info->coreChannelSize = core->coreChannelSize;
44
46 return API::Success;
47}
Result
Enumeration of generic kernel API result codes.
Definition API.h:69
@ Success
Definition API.h:70
virtual Size size() const
Get memory size.
Definition Allocator.cpp:64
CoreInfo * getCoreInfo()
Get CoreInfo.
Definition Kernel.cpp:158
SplitAllocator * getAllocator()
Get physical memory allocator.
Definition Kernel.cpp:138
static Size copy(void *dest, const void *src, Size count)
Copy memory from one place to another.
Allocator which separates kernel mapped memory at virtual and physical addresses.
virtual Size available() const
Get memory available.
static Kernel * instance()
Retrieve the instance.
Definition Singleton.h:86
API::Result SystemInfoHandler(SystemInformation *info)
Kernel prototype.
CoreInfo coreInfo
Local CoreInfo instance.
#define DEBUG(msg)
Output a debug message to standard output.
Definition Log.h:89
Per-Core information structure.
Definition CoreInfo.h:61
uint timerCounter
Arch-specific timer counter.
Definition CoreInfo.h:99
Address bootImageSize
Boot image size in bytes.
Definition CoreInfo.h:84
Memory::Range kernel
Kernel memory range.
Definition CoreInfo.h:75
Size coreChannelSize
Size of the IPC channel in bytes.
Definition CoreInfo.h:90
uint coreId
Core identifier.
Definition CoreInfo.h:66
Address coreChannelAddress
Physical memory address of IPC channel for CoreServer of this core.
Definition CoreInfo.h:87
Address bootImageAddress
Boot image physical memory address.
Definition CoreInfo.h:81
char kernelCommand[KERNEL_PATHLEN]
Kernel command.
Definition CoreInfo.h:78
Size size
Size in number of bytes.
Definition Memory.h:59
Address phys
Physical address.
Definition Memory.h:58
System information structure.
Definition SystemInfo.h:80
Size memorySize
Total and available memory in bytes.
Definition SystemInfo.h:102
Address bootImageAddress
BootImage physical address.
Definition SystemInfo.h:108
char cmdline[64]
Boot commandline.
Definition SystemInfo.h:93
Address kernelAddress
Physical start address of the kernel program.
Definition SystemInfo.h:96
Size bootImageSize
BootImage size.
Definition SystemInfo.h:111
Size kernelSize
Size of the kernel program in bytes.
Definition SystemInfo.h:99
uint coreId
Core Identifier.
Definition SystemInfo.h:105
Address coreChannelAddress
Definition SystemInfo.h:113
uint timerCounter
Timer counter.
Definition SystemInfo.h:117
ulong version
System version.
Definition SystemInfo.h:90