What is a bootstrap program?

Alex Onsman
Updated on 22-Jun-2020 15:07:19

14K+ Views

A bootstrap program is the first code that is executed when the computer system is started. The entire operating system depends on the bootstrap program to work correctly as it loads the operating system.A figure that demonstrates the use of the bootstrap program is as follows −In the above image, the bootstrap program is a part of ROM which is the non-volatile memory. The operating system is loaded into the RAM by the bootstrap program after the start of the computer system. Then the operating system starts the device drivers.Bootstrapping ProcessThe bootstrapping process does not require any outside input to ... Read More

Advantages of using Loadable Kernel Modules

Kristi Castro
Updated on 22-Jun-2020 15:06:46

1K+ Views

Loadable kernel modules in an operating system is an object file that contains code to extend the running kernel, which is also known as the base kernel. The loadable kernel modules are used to add support for file systems, hardware, system calls etc.A figure that shows the loadable modules of the operating system is as follows −Advantage of Loadable Kernel ModulesAn operating system would have to include all the systems that provided all anticipated functionalities in the base kernel if there were no loadable modules. This would lead to wastage of memory as most of those systems would not be ... Read More

How does System Boot work?

Alex Onsman
Updated on 22-Jun-2020 15:06:12

2K+ Views

The BIOS, operating system and hardware components of a computer system should all be working correctly for it to boot. If any of these elements fail, it leads to a failed boot sequence.System Boot ProcessThe following diagram demonstrates the steps involved in a system boot process −Here are the steps −The CPU initializes itself after the power in the computer is first turned on. This is done by triggering a series of clock ticks that are generated by the system clock.After this, the CPU looks for the system’s ROM BIOS to obtain the first instruction in the start-up program. This ... Read More

Operating System Debugging

David Meador
Updated on 22-Jun-2020 15:05:15

5K+ Views

Debugging is the process of finding the problems in a computer system and solving them. There are many different ways in which operating systems perform debugging. Some of these are −Log FilesThe log files record all the events that occur in an operating system. This is done by writing all the messages into a log file. There are different types of log files. Some of these are given as follows −Event LogsThese stores the records of all the events that occur in the execution of a system. This is done so that the activities of all the events can be ... Read More

C# program to get the total number of cores on a computer

Ankith Reddy
Updated on 22-Jun-2020 15:03:52

103 Views

Use the Environment.ProcessorCount to get the total number of cores on a computer −Environment.ProcessorCountThe following is the code that displays the total number of cores on a computer in C# −ExampleUsing System; namespace Demo {    class Program {       static void Main(string[] args) {          Console.WriteLine(Environment.ProcessorCount);       }    } }

C# program to get the extension of a file in C#

Arjun Thakur
Updated on 22-Jun-2020 15:03:30

148 Views

To handle file paths, the Path class is used in C#.Set the file name in a string −string myPath = "D:ew\quiz.txt";Now, to get the extension, use the GetExtension() method −Path.GetExtension(myPath)Here is the complete code −Example Live Demousing System; using System.IO; namespace Demo {    class Program {       static void Main(string[] args) {          string myPath = "D:ew\quiz.txt";          Console.WriteLine(Path.GetExtension(myPath));       }    } }Output.txt

C# program to get the file name in C#

Chandu yadav
Updated on 22-Jun-2020 15:03:07

440 Views

Set the path name in a string −string myPath = "D:ew\quiz.txt";Now, use the GetFileName() method to get the name of the file −Path.GetFileName(myPath)The following is the complete code −Example Live Demousing System; using System.IO; namespace Demo {    class Program {       static void Main(string[] args) {          string myPath = "D:ew\quiz.txt";          // get extension          Console.WriteLine("Extension: "+Path.GetExtension(myPath));          // get path          Console.WriteLine("File Path: "+Path.GetFileName(myPath));       }    } }OutputExtension: .txt File Path: D:ew\quiz.txt

Environment.NewLine in C#

Arjun Thakur
Updated on 22-Jun-2020 15:02:36

917 Views

The Enviornment.NewLine in C# is used to add newline.To set a new line in between words −str = "This is demo text!" + Environment.NewLine + "This is demo text on next line!";The following is the code −Example Live Demousing System; using System.IO; namespace Demo {    class Program {       static void Main(string[] args) {          string str = "This is demo text!" + Environment.NewLine + "This is demo text on next line!";          Console.Write(str);       }    } }OutputThis is demo text! This is demo text on next line!

GetLogicalDrives in C#

Chandu yadav
Updated on 22-Jun-2020 15:02:11

115 Views

To get all the disk drives on a system, use the GetLogicalDrives() method in C# −Environment.GetLogicalDrives()Use it with Join method to get the comma-separated list of logical drives −string.Join(",", Environment.GetLogicalDrives())Example Live Demousing System; using System.IO; namespace Demo {    class Program {       static void Main(string[] args) {          Console.WriteLine(string.Join(",", Environment.GetLogicalDrives()));       }    } }Output/,/etc/resolv.conf,/etc/hostname,/etc/hosts,/run/secrets,/home/cg/root

EnumerateFiles method in C#

George John
Updated on 22-Jun-2020 15:01:48

130 Views

EnumerateFile() method is used in C# to get all the files. Use AllDirectories property to recurse through directories −Directory.EnumerateFiles(@"D:\NEW", "*.*", SearchOption.AllDirectories)To get the list of files in a directory, use the SearchOptions.AllDirectories in C# as shown above.Let us see how −Exampleusing System; using System.IO; namespace Demo {    class Program {       static void Main(string[] args) {          foreach (string allFiles is Directory.EnumerateFiles(@"D:\NEW","*.*",SearchOption.AllDirectories)) {             Console.WriteLine(allFiles);          }       }    } }OutputThe following is the output −D:\NEW\my.txt D:\NEW\amit.html D:\NEW\tutorials\java\a.java

Advertisements