Skip to content

Commit ae78de7

Browse files
committed
chainloader: Add verbose setting, disabled by default
1 parent 4fab19d commit ae78de7

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

src/chainload/service.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@
1515
// See the License for the specific language governing permissions and
1616
// limitations under the License.
1717

18-
#include <os>
19-
#include <cstdint>
18+
#include <kernel/os.hpp>
19+
#include <kernel/syscalls.hpp>
2020
#include <util/elf_binary.hpp>
21+
#include <service>
22+
#include <cstdint>
2123

22-
bool verb = true;
23-
#define MYINFO(X,...) INFO("chainload", X, ##__VA_ARGS__)
24+
static const bool verb = false;
25+
#define MYINFO(X,...) \
26+
if (verb) { INFO("chainload", X, ##__VA_ARGS__); }
2427

2528
extern "C" void hotswap(const char* base, int len, char* dest, void* start,
2629
uintptr_t magic, uintptr_t bootinfo);
@@ -53,7 +56,7 @@ void Service::start()
5356
sizeof(void*) * 8, mods.size());
5457

5558
if (mods.size() <= 0) {
56-
MYINFO("Nothing to do. Exiting.");
59+
MYINFO("No modules passed to multiboot. Exiting.");
5760
exit(1);
5861
}
5962
multiboot_module_t binary = mods[0];
@@ -87,4 +90,5 @@ void Service::start()
8790
((decltype(&hotswap))hotswap_addr)(base, len, dest, start, __multiboot_magic, __multiboot_addr);
8891

8992
panic("Should have jumped\n");
93+
__builtin_unreachable();
9094
}

0 commit comments

Comments
 (0)