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 
39  info->bootImageAddress = core->bootImageAddress;
40  info->bootImageSize = core->bootImageSize;
41  info->timerCounter = core->timerCounter;
43  info->coreChannelSize = core->coreChannelSize;
44 
46  return API::Success;
47 }
MemoryBlock::copy
static Size copy(void *dest, const void *src, Size count)
Copy memory from one place to another.
Definition: MemoryBlock.cpp:36
SplitAllocator.h
API::Result
Result
Enumeration of generic kernel API result codes.
Definition: API.h:68
CoreInfo::bootImageSize
Address bootImageSize
Boot image size in bytes.
Definition: CoreInfo.h:84
SplitAllocator::available
virtual Size available() const
Get memory available.
Definition: SplitAllocator.cpp:30
SystemInformation::coreChannelAddress
Address coreChannelAddress
Definition: SystemInfo.h:113
SystemInformation::kernelSize
Size kernelSize
Size of the kernel program in bytes.
Definition: SystemInfo.h:99
Kernel::getAllocator
SplitAllocator * getAllocator()
Get physical memory allocator.
Definition: Kernel.cpp:138
CoreInfo::coreChannelAddress
Address coreChannelAddress
Physical memory address of IPC channel for CoreServer of this core.
Definition: CoreInfo.h:87
SystemInformation::coreChannelSize
Size coreChannelSize
Definition: SystemInfo.h:114
SystemInformation::coreId
uint coreId
Core Identifier.
Definition: SystemInfo.h:105
CoreInfo::coreId
uint coreId
Core identifier.
Definition: CoreInfo.h:66
SplitAllocator
Allocator which separates kernel mapped memory at virtual and physical addresses.
Definition: SplitAllocator.h:37
DEBUG
#define DEBUG(msg)
Output a debug message to standard output.
Definition: Log.h:89
CoreInfo::kernelCommand
char kernelCommand[KERNEL_PATHLEN]
Kernel command.
Definition: CoreInfo.h:78
Kernel::getCoreInfo
CoreInfo * getCoreInfo()
Get CoreInfo.
Definition: Kernel.cpp:158
Memory::Range::phys
Address phys
Physical address.
Definition: Memory.h:58
WeakSingleton< Kernel >::instance
static Kernel * instance()
Retrieve the instance.
Definition: Singleton.h:86
Allocator::size
virtual Size size() const
Get memory size.
Definition: Allocator.cpp:64
CoreInfo::bootImageAddress
Address bootImageAddress
Boot image physical memory address.
Definition: CoreInfo.h:81
SystemInformation::bootImageSize
Size bootImageSize
BootImage size.
Definition: SystemInfo.h:111
SystemInformation::cmdline
char cmdline[64]
Boot commandline.
Definition: SystemInfo.h:93
CoreInfo
Per-Core information structure.
Definition: CoreInfo.h:60
coreInfo
CoreInfo coreInfo
Local CoreInfo instance.
CoreInfo::timerCounter
uint timerCounter
Arch-specific timer counter.
Definition: CoreInfo.h:99
SystemInformation
System information structure.
Definition: SystemInfo.h:79
CoreInfo::coreChannelSize
Size coreChannelSize
Size of the IPC channel in bytes.
Definition: CoreInfo.h:90
SystemInformation::timerCounter
uint timerCounter
Timer counter.
Definition: SystemInfo.h:117
CoreInfo::kernel
Memory::Range kernel
Kernel memory range.
Definition: CoreInfo.h:75
API::Success
@ Success
Definition: API.h:70
SystemInformation::memorySize
Size memorySize
Total and available memory in bytes.
Definition: SystemInfo.h:102
CoreInfo.h
Memory::Range::size
Size size
Size in number of bytes.
Definition: Memory.h:59
SystemInformation::version
ulong version
System version.
Definition: SystemInfo.h:90
SystemInformation::kernelAddress
Address kernelAddress
Physical start address of the kernel program.
Definition: SystemInfo.h:96
SystemInfoHandler
API::Result SystemInfoHandler(SystemInformation *info)
Kernel prototype.
Definition: SystemInfo.cpp:24
SystemInformation::memoryAvail
Size memoryAvail
Definition: SystemInfo.h:102
SystemInformation::bootImageAddress
Address bootImageAddress
BootImage physical address.
Definition: SystemInfo.h:108