When BOOTDEVICE is defined get_root_dev() was always returning
the same device entering in an infinite loop with the only
effect of scroll out all the previous messages.
inline uint16_t get_root_dev(void)
{
- return BOOTDEVICE;
+ static uint8_t first = 1;
+
+ if (first) {
+ first = 0;
+ return BOOTDEVICE;
+ }
+ return BAD_ROOT_DEV;
}
#endif
old_argptr = argptr;
/* Get a root device to try */
root_dev = get_root_dev();
+ if (root_dev == BAD_ROOT_DEV)
+ panic(PANIC_NOROOT);
/* Mount the root device */
kprintf("Mounting root fs (root_dev=%d, r%c): ", root_dev, ro ? 'o' : 'w');
if(fmount(root_dev, NULLINODE, ro) == 0)