LoGin 2b7818e80e
feat: 添加对内核引导协议的抽象 (#913)
* 添加multiboot header

* head.S传参增加bootloader类型

* feat: 添加引导加载协议的抽象,并为multiboot2实现这个抽象.

* 把framebuffer的映射地址改为从early ioremap和mmio pool分配

* riscv64能运行
2024-09-05 21:12:20 +08:00

24 lines
641 B
C

#include <sys/time.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
int main()
{
struct timeval *tv = malloc(sizeof(struct timeval));
struct timezone *tz = malloc(sizeof(struct timezone));
for (int i = 0; i < 15; i++)
{
gettimeofday(tv, NULL);
printf("%ld.%06ld\n", tv->tv_sec, tv->tv_usec);
for (int i = 0; i < 10; i++)
{
usleep(500000);
}
}
gettimeofday(tv, NULL);
printf("tv = %ld.%06ld\n", tv->tv_sec, tv->tv_usec);
// printf("tz_minuteswest = %d,tz_dsttime = %d", (*tz).tz_minuteswest, (*tz).tz_dsttime);
return 0;
}