OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 9:49 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: MS-DOS 6.22 command.com: software or kernel?
PostPosted: Sun May 09, 2021 11:48 pm 
Offline

Joined: Sun May 09, 2021 11:30 pm
Posts: 3
From BIOS detecting the hard drive's MBR, and the MBR putting IO.SYS and MSDOS.sys into memory and initialing the IO.SYS. Would the command.com be user-mode application? I'll look at the command.com through a hex editor to see if I see an MZ. I only have seen the MZ in the first type bytes of Windows 3.11 win.exe and I believe setup.exe of Windows 3.11.

If I'm right about command.com being user-mode, IO.SYS and MSDOS.SYS would be in kernel mode. Correct? Kernel Mode and User Mode is somewhat blurry to me. I get that kernel mode is 0 ring and user mode is ring 3. Ring 0 would indicate most privledge and have access to everything on the hardware. Whereas, user-mode does not and has to ask permission from the kernel to get access or manipulate hardware such as reading from disk.

Currently, I'm following a tutorial that does UEFI in C++. So far, I really do like it. However, he hasn't uploaded a newer video. I just want to start off small like a command line interpreter.

The below workflow or so far what I have in my head:

Computer Boots -> UEFI -> My Kernel -> My Kernel Finds System.Bin (or something) -> Reads Config (System.Conf) -> Finished with all initialization -> Launch Terminal.exe (Command line Interpreter).

Am I going in the right direction with this idea?


Top
 Profile  
 
 Post subject: Re: MS-DOS 6.22 command.com: software or kernel?
PostPosted: Mon May 10, 2021 12:51 am 
Offline
Member
Member

Joined: Wed Oct 01, 2008 1:55 pm
Posts: 3191
MS-DOS runs in real mode and real mode has no kernel / user mode concept. Rather, everything runs in kernel mode. OTOH, if you run MS-DOS under another OS, then the applications can run in user mode (in V86 mode) and the MS-DOS API can be virtualized by the host operating system so the system services actually run in kernel mode.

Still, if you plan to do something with UEFI, the operation of MS-DOS is not relevant.


Top
 Profile  
 
 Post subject: Re: MS-DOS 6.22 command.com: software or kernel?
PostPosted: Mon May 10, 2021 1:24 am 
Offline

Joined: Sun May 09, 2021 11:30 pm
Posts: 3
rdos wrote:
MS-DOS runs in real mode and real mode has no kernel / user mode concept. Rather, everything runs in kernel mode. OTOH, if you run MS-DOS under another OS, then the applications can run in user mode (in V86 mode) and the MS-DOS API can be virtualized by the host operating system so the system services actually run in kernel mode.

Still, if you plan to do something with UEFI, the operation of MS-DOS is not relevant.


Ah. Okay. Can I still go from kernel mode and make a C++ program with my own API to gain access or ask permission to my kernel's mechanics? If my kernel has a disk read function, and my custom API used by my future applications to ask permission for the kernel to read disk.

if kernel function is: _kReadDisk.
My Api function is: ReadDisk.
My future applications in user mode would include my API and use the ReadDisk function.
That's what I believe what I'm aiming for.


Top
 Profile  
 
 Post subject: Re: MS-DOS 6.22 command.com: software or kernel?
PostPosted: Mon May 10, 2021 2:49 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
That's what system calls are for - to allow a user application to call a kernel routine.


Top
 Profile  
 
 Post subject: Re: MS-DOS 6.22 command.com: software or kernel?
PostPosted: Mon May 10, 2021 12:10 pm 
Offline

Joined: Sun May 09, 2021 11:30 pm
Posts: 3
iansjack wrote:
That's what system calls are for - to allow a user application to call a kernel routine.


Thank you. :)


Top
 Profile  
 
 Post subject: Re: MS-DOS 6.22 command.com: software or kernel?
PostPosted: Mon May 10, 2021 1:25 pm 
Offline
Member
Member

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 1071
To answer your direct question, the kernel is still software. It just has higher privileges. Now in the MS-DOS case, all software has the same privileges, as @rdos pointed out. But, however, MS-DOS wise, IO.SYS and MSDOS.SYS (and to a lesser extent, the BIOS) are considered the "kernel" per se.

_________________
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg


Top
 Profile  
 
 Post subject: Re: MS-DOS 6.22 command.com: software or kernel?
PostPosted: Thu Jun 10, 2021 9:17 am 
Offline
Member
Member

Joined: Wed Oct 31, 2007 9:09 am
Posts: 1385
SIC88 wrote:
I'll look at the command.com through a hex editor to see if I see an MZ

That won't do you much good, as the MZ header is used for EXE files, not for COM files.


JAL


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Majestic-12 [Bot], SemrushBot [Bot] and 67 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group