projects
/
seabios.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
091dd17
)
tsc crap :/
author
Bernhard Urban
<lewurm@gmail.com>
Fri, 6 Apr 2012 12:25:09 +0000
(14:25 +0200)
committer
Bernhard Urban
<lewurm@gmail.com>
Fri, 6 Apr 2012 12:25:09 +0000
(14:25 +0200)
src/clock.c
patch
|
blob
|
history
src/post.c
patch
|
blob
|
history
diff --git
a/src/clock.c
b/src/clock.c
index e8a48a13c1733bdd20b3f176dc829eeaabc1a6df..d88515c45c482153144365c90b099c465b5076e8 100644
(file)
--- a/
src/clock.c
+++ b/
src/clock.c
@@
-81,6
+81,7
@@
calibrate_tsc(void)
}
// Setup "timer2"
}
// Setup "timer2"
+#if 0
u8 orig = inb(PORT_PS2_CTRLB);
outb((orig & ~PPCB_SPKR) | PPCB_T2GATE, PORT_PS2_CTRLB);
/* binary, mode 0, LSB/MSB, Ch 2 */
u8 orig = inb(PORT_PS2_CTRLB);
outb((orig & ~PPCB_SPKR) | PPCB_T2GATE, PORT_PS2_CTRLB);
/* binary, mode 0, LSB/MSB, Ch 2 */
@@
-104,6
+105,10
@@
calibrate_tsc(void)
, (u32)start, (u32)end, (u32)diff);
u32 hz = diff * PIT_TICK_RATE / CALIBRATE_COUNT;
SET_GLOBAL(cpu_khz, hz / 1000);
, (u32)start, (u32)end, (u32)diff);
u32 hz = diff * PIT_TICK_RATE / CALIBRATE_COUNT;
SET_GLOBAL(cpu_khz, hz / 1000);
+#else
+ u32 hz = 800 * 1000000;
+ SET_GLOBAL(cpu_khz, hz / 1000);
+#endif
dprintf(1, "CPU Mhz=%u\n", hz / 1000000);
}
dprintf(1, "CPU Mhz=%u\n", hz / 1000000);
}
@@
-252,20
+257,34
@@
void
timer_setup(void)
{
dprintf(3, "init timer\n");
timer_setup(void)
{
dprintf(3, "init timer\n");
+#if 1
calibrate_tsc();
calibrate_tsc();
+#endif
+ dprintf(3, "init timer: 01\n");
pit_setup();
pit_setup();
+ dprintf(3, "init timer: 02\n");
init_rtc();
init_rtc();
+ dprintf(3, "init timer: 03\n");
rtc_updating();
rtc_updating();
+ dprintf(3, "init timer: 04\n");
u32 seconds = bcd2bin(inb_cmos(CMOS_RTC_SECONDS));
u32 seconds = bcd2bin(inb_cmos(CMOS_RTC_SECONDS));
+ dprintf(3, "init timer: 05\n");
u32 minutes = bcd2bin(inb_cmos(CMOS_RTC_MINUTES));
u32 minutes = bcd2bin(inb_cmos(CMOS_RTC_MINUTES));
+ dprintf(3, "init timer: 06\n");
u32 hours = bcd2bin(inb_cmos(CMOS_RTC_HOURS));
u32 hours = bcd2bin(inb_cmos(CMOS_RTC_HOURS));
+ dprintf(3, "init timer: 07\n");
u32 ticks = (hours * 60 + minutes) * 60 + seconds;
u32 ticks = (hours * 60 + minutes) * 60 + seconds;
+ dprintf(3, "init timer: 08\n");
ticks = ((u64)ticks * PIT_TICK_RATE) / PIT_TICK_INTERVAL;
ticks = ((u64)ticks * PIT_TICK_RATE) / PIT_TICK_INTERVAL;
+ dprintf(3, "init timer: 09\n");
SET_BDA(timer_counter, ticks);
SET_BDA(timer_counter, ticks);
+ dprintf(3, "init timer: 10\n");
enable_hwirq(0, FUNC16(entry_08));
enable_hwirq(0, FUNC16(entry_08));
+ dprintf(3, "init timer: 11\n");
enable_hwirq(8, FUNC16(entry_70));
enable_hwirq(8, FUNC16(entry_70));
+ dprintf(3, "init timer: 12\n");
}
}
diff --git
a/src/post.c
b/src/post.c
index b4ad1fa07b3dde5ec9c7d8870bf18315c116af8f..7c76959f23611f68638dc049c629e66ee5867450 100644
(file)
--- a/
src/post.c
+++ b/
src/post.c
@@
-244,13
+244,19
@@
maininit(void)
// Setup interfaces that option roms may need
bios32_setup();
// Setup interfaces that option roms may need
bios32_setup();
+ dprintf(3, "[wurm] pmm_setup\n");
pmm_setup();
pmm_setup();
+ dprintf(3, "[wurm] pnp_setup\n");
pnp_setup();
pnp_setup();
+ dprintf(3, "[wurm] kbd_setup\n");
kbd_setup();
kbd_setup();
+ dprintf(3, "[wurm] mouse_setup\n");
mouse_setup();
mouse_setup();
+ dprintf(3, "[wurm] init_bios_tables\n");
init_bios_tables();
// Run vga option rom
init_bios_tables();
// Run vga option rom
+ dprintf(3, "[wurm] vga_setup\n");
vga_setup();
// Do hardware initialization (if running synchronously)
vga_setup();
// Do hardware initialization (if running synchronously)