2011-03-26 21:30:08 +03:00
|
|
|
/*
|
|
|
|
* vim:tabstop=4
|
|
|
|
* vim:noexpandtab
|
|
|
|
*
|
|
|
|
* Kernel Argument Parser
|
|
|
|
*/
|
|
|
|
#include <system.h>
|
|
|
|
|
|
|
|
void
|
|
|
|
parse_args(char * arg) {
|
2011-03-29 05:34:53 +04:00
|
|
|
if (!arg) { return; }
|
2011-03-26 21:30:08 +03:00
|
|
|
char * pch;
|
|
|
|
char * cmd;
|
|
|
|
char * save;
|
|
|
|
pch = strtok_r(arg," ",&save);
|
|
|
|
cmd = pch;
|
|
|
|
if (!cmd) { return; }
|
|
|
|
char * argv[1024]; /* Command tokens (space-separated elements) */
|
|
|
|
int tokenid = 0;
|
|
|
|
while (pch != NULL) {
|
|
|
|
argv[tokenid] = (char *)pch;
|
|
|
|
++tokenid;
|
|
|
|
pch = strtok_r(NULL," ",&save);
|
|
|
|
}
|
|
|
|
argv[tokenid] = NULL;
|
|
|
|
for (int i = 0; i < tokenid; ++i) {
|
|
|
|
if (!strcmp(argv[i],"vid=qemu")) {
|
|
|
|
/* QEMU Video Mode, we are free to set things for 1024x768 */
|
|
|
|
graphics_install_bochs();
|
2011-03-27 22:41:00 +04:00
|
|
|
bochs_draw_logo("/bs.bmp");
|
2011-03-29 04:34:44 +04:00
|
|
|
char * welcome = "Welcome to \200\201\202OS!\n";
|
2011-03-29 01:33:07 +04:00
|
|
|
for (uint16_t i = 0; i < strlen(welcome); ++i) {
|
2011-03-29 04:34:44 +04:00
|
|
|
bochs_write(welcome[i]);
|
2011-03-29 01:33:07 +04:00
|
|
|
}
|
2011-03-26 21:30:08 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|