Added Haiku revision number to the kernel (same mechanism as used for

libroot). It's available in the kernel through the private
get_haiku_revision() and added to the kernel syslog output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21173 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2007-05-19 15:36:32 +00:00
parent fe4a47a92a
commit bdf8a2e1e7
5 changed files with 28 additions and 1 deletions

View File

@ -158,7 +158,7 @@ AddDriversToHaikuImage net : $(BEOS_ADD_ONS_DRIVERS_NET) ;
#AddDriversToHaikuImage power : $(BEOS_ADD_ONS_DRIVERS_ACPI) ;
# kernel
AddFilesToHaikuImage beos system : kernel_$(TARGET_ARCH) ;
AddFilesToHaikuImage beos system : <revisioned>kernel_$(TARGET_ARCH) ;
# libs
AddFilesToHaikuImage beos system lib : $(BEOS_SYSTEM_LIB) ;

View File

@ -16,6 +16,8 @@ extern "C" {
#endif
extern status_t system_info_init(struct kernel_args *args);
extern uint32 get_haiku_revision(void);
extern status_t _user_get_system_info(system_info *userInfo, size_t size);
#ifdef __cplusplus

View File

@ -118,6 +118,17 @@ Depends kernel.so : kernel ;
# kernel.so will be rebuilt with the kernel
# Copy kernel and update the copy's revision section. We link everything
# against the original, but the copy will end up on the disk image (this way
# we avoid unnecessary dependencies). The copy will be located in a subdirectory.
if $(TARGET_PLATFORM) = haiku {
MakeLocate <revisioned>kernel_$(TARGET_ARCH)
: [ FDirName $(TARGET_DEBUG_$(DEBUG)_LOCATE_TARGET) revisioned ] ;
CopySetHaikuRevision <revisioned>kernel_$(TARGET_ARCH)
: kernel_$(TARGET_ARCH) ;
}
SubInclude HAIKU_TOP src system kernel arch ;
SubInclude HAIKU_TOP src system kernel cache ;
SubInclude HAIKU_TOP src system kernel device_manager ;

View File

@ -94,6 +94,7 @@ _start(kernel_args *bootKernelArgs, int currentCPU)
debug_init(&sKernelArgs);
set_dprintf_enabled(true);
dprintf("Welcome to kernel debugger output!\n");
dprintf("Haiku revision: %lu\n", get_haiku_revision());
// init modules
TRACE("init CPU\n");

View File

@ -32,6 +32,12 @@ const static int64 kKernelVersion = 0x1;
const static char *kKernelName = "kernel_" HAIKU_ARCH;
// Haiku SVN revision. Will be set when copying the kernel to the image.
// Lives in a separate section so that it can easily be found.
static uint32 sHaikuRevision __attribute__((section("_haiku_revision")));
static uint32 sHaikuRevision = 0;
static int
dump_info(int argc, char **argv)
{
@ -107,6 +113,13 @@ system_info_init(struct kernel_args *args)
}
uint32
get_haiku_revision(void)
{
return sHaikuRevision;
}
// #pragma mark -