kernel: show current task id, thread id, and cpu id in test messages
This commit is contained in:
19
init/main.c
19
init/main.c
@@ -15,10 +15,6 @@
|
||||
#include <socks/tty.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef KEXT_NET_DOORSTUCK_SOCKS_FBCON
|
||||
#include <socks/fbcon.h>
|
||||
#endif
|
||||
|
||||
extern unsigned long get_rflags(void);
|
||||
|
||||
extern char __pstart[], __pend[];
|
||||
@@ -30,19 +26,30 @@ void print_kernel_banner(void)
|
||||
|
||||
static void hang(void)
|
||||
{
|
||||
struct task *self = current_task();
|
||||
struct thread *thread = current_thread();
|
||||
|
||||
while (1) {
|
||||
printk("%d: tick", this_cpu());
|
||||
printk("[cpu %u, task %u, thread %u]: tick",
|
||||
this_cpu(),
|
||||
self->t_id,
|
||||
thread->tr_id);
|
||||
milli_sleep(2000);
|
||||
}
|
||||
}
|
||||
|
||||
void background_thread(void)
|
||||
{
|
||||
struct task *self = current_task();
|
||||
struct thread *thread = current_thread();
|
||||
printk("background_thread() running on processor %u", this_cpu());
|
||||
milli_sleep(1000);
|
||||
|
||||
while (1) {
|
||||
printk("%d: tock", this_cpu());
|
||||
printk("[cpu %u, task %u, thread %u]: tock",
|
||||
this_cpu(),
|
||||
self->t_id,
|
||||
thread->tr_id);
|
||||
milli_sleep(2000);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user