Internal and external DOS commands. Creating a file in MS-DOS. Main types of random access memory (RAM). mem is a standard RAM card. a: - switch to drive a

Serves to display information about free and occupied memory areas and programs located in the memory of the MS-DOS subsystem. When running the command mem without parameters, information about free and used memory of the MS-DOS subsystem is displayed on the screen.

Syntax

mem [{/program | /debug | /classify}]

Options

/program Displays information about programs loaded into memory. /debug Display information about downloaded programs and internal drivers, as well as other information. /classify Displays information about programs loaded into regular memory and into the upper memory area. /? Display help on the command line.

Notes

  • Using the parameter /program

    Parameter /program /debug or /classify /p instead of /program.

  • Using the parameter /debug

    Parameter /debug cannot be used in conjunction with the parameter /program or /classify. Abbreviation allowed /d instead of /debug.

  • Using the parameter /classify

    Parameter /classify Provides decimal and hexadecimal size information for each program, memory usage totals, and a list of the largest memory blocks available. Parameter /classify cannot be used in conjunction with the parameter /program or /debug. Abbreviation allowed /c instead of /classify.

  • Displaying memory status information

    The MS-DOS subsystem displays information about the status of extended memory only if anything is loaded into memory at addresses greater than 1 MB.

Examples

Let's assume the MS-DOS subsystem is configured to use extended memory. To display information about the usage of all memory areas - normal, extended and displayed, as well as to display information about loaded programs, use the following command:

mem/program

The result will look something like this:

Address Name Size Type 000000 000400 Interrupt vector 000400 000100 ROM exchange area 000500 000200 DOS exchange area 000700 IO 000310 System data 000A10 MSDOS 0014D0 System data 001EE0 IO 0018 D0 System data KBD 000800 System program HIMEM 000420 DEVICE= 000340 FILES= 000090 FCBS= 000170 LASTDRIVE= 000710 STACKS= 0037C0 COMMAND 000A40 Program 004210 MSDOS 000070 - Free - 004290 COMMAND 0001F0 Environment 004 490 MEM 0001D0 Environment 004670 MEM 017550 Program 01BBD0 MSDOS 084410 - Free - 09FFF0 SYSTEM 028000 System program 0C8000 IO 0083D0 System data MOUSE 0083C0 System program 0D03E0 MSDOS 000050 - Free - 0D0440 REDIR 0009F0 Program 0D0E40 DOSX 007CA0 Program 0D8AF0 DOSX 001030 Data 0D9B30 MSDOS 0164C0 - Free - 65 5360 bytes - total regular memory 655360 bytes - available for MS-DOS 637296 maximum size executable program 1048576 bytes - total contiguous additional memory 0 bytes - available contiguous additional memory 405504 bytes - available XMS memory resident portion of MS-DOS loaded into HMA segment

  • "Total Regular Memory" represents the amount virtual memory, allocated to the MS-DOS subsystem up to the first 640 KB.
  • "Available for MS-DOS" represents the amount of regular memory allocated, including the memory required by Cmd.exe.
  • The "maximum executable program size" is equal to the size of the largest contiguous block of ordinary memory available to programs.
  • "Total EMS Memory" (not shown in the previous example) is the amount of mapped memory that can be used by the MS-DOS subsystem.
  • "EMS Memory Free" (not shown in the previous example) is equal to the amount of displayed memory available to programs.
  • "Total contiguous additional memory" equals the amount of memory above 1 MB.
  • "Continuous additional memory available" is the amount of memory available through the 15h interrupt interface. This memory is not used by extended memory managers such as Himem.sys. Some older programs use this scheme for organizing additional memory.
  • "XMS Available Memory" is the amount of memory that is used by extended memory managers such as Himem.sys and is available for use by programs.
02/12/15 21.1K

Why is there such chaos in the world? Yes, because the administrator of our system forgot to fulfill his duties. Or just lost cmd list commands from our world. Although this is a somewhat original look at the existing order of things, it nevertheless reflects part of the truth we need: using the command line, you can easily bring order to your computer:

What is the command line

The command line is the simplest tool for managing your computer's operating system. Control occurs using a number of reserved commands and character sets text keyboard without the mouse ( V operating system Windows).

On UNIX-based systems, when working with command line It is possible to use a mouse.

Some commands came to us from MS-DOS. The command line is also called the console. It is used not only for administering the operating system, but also for managing regular programs. Most often, the most rarely used commands are included in this set of commands.

The advantage of using cmd main commands is that it consumes a minimum amount of system resources. And this is important when emergency situations, when all the computer’s power is, one way or another, involved.

In cmd the ability to execute and create integers is implemented batch files, representing certain order execution of a number of commands (scripts). Thanks to this, they can be used to automate certain tasks ( account management, data archiving and more).

Team Windows shell To manipulate and redirect commands to certain utilities and operating system tools, the Cmd.exe interpreter is used. It loads the console and redirects commands in a format that the system understands.

Working with the command line in the Windows operating system

You can call the console in Windows in several ways:


Both methods involve running the console as current user. That is, with all the rights and restrictions that are imposed on its role in the operating system. For launch cmd with administrator rights, you need to select the program icon in the Start menu and in context menu select the appropriate item:


After running the utility you can get background information about commands and the format for writing them in the console. To do this, enter the help statement and press “Enter”:

Basic commands for working with files and directories

The most frequently used commands are:

  • RENAME – renaming directories and files. Command syntax:

RENAME | REN [drive/path] original name file/directory | final filename
Example: RENAME C:UsershomeDesktoptost.txt test.txt

  • DEL (ERASE) – used to delete files only, not directories. Its syntax is:

DEL | ERASE [processing method] [filename]
Example: Del C:UsershomeDesktoptest.txt/P

By processing method we mean a special flag that allows you to implement a certain condition when deleting a file. In our example, the “P” flag enables the display of a permission dialog for deleting each file:


More details about the possible values ​​of the “processing method” parameter can be found in technical documentation on the Windows operating system.

  • MD – allows you to create a folder at the specified path. Syntax:

MD [drive:] [path]
Example:
MD C:UsershomeDesktoptest1test2

The example will create a subfolder test2 within the test1 folder. If one of the path's root folders does not exist, it will be created too:

  • RD ( RMDIR) – deletion specific folder or all directories in the specified path. Syntax:

RD | RMDIR [process_key] [drive/path]
Example:
rmdir /s C:UsershomeDesktoptest1test2

The example uses the s flag, which will cause the entire branch of directories specified in the path to be deleted. Therefore, you should not use it unnecessarily rmdir command with this processing key.

In the next section, we'll take a closer look at network cmd commands.

Commands for working with the network

The command line allows you to manage not only file system PC, but also his networking opportunities. Part network commands console included a large number of operators to monitor and test the network. The most relevant of them are:

  • ping – the command is used to monitor capabilities network connection PC. To a remote computer a set number of packets are sent and then sent back. The transmission time of packets and the percentage of losses are taken into account. Syntax:

ping [-t] [-a] [-n counter] [-l size] [-f] [-i TTL] [-v type] [-r counter] [-s counter] [(-j host_list | - k node_list)] [-w interval] [target_PC_name]

Example command implementation:
ping example.microsoft.com
ping –w 10000 192.168.239.132

In the last example cmd The ping command sends a request to the recipient with the specified IP address. The waiting interval between packets is 10,000 (10 seconds). By default this parameter is set to 4000:

  • tracert – used to determine the network path to a specified resource by sending a special echo message through the protocol
  • ICMP (Control Message Protocol). After running the command with parameters, a list of all routers through which the message passes is displayed. The first element in the list is the first router on the side of the requested resource.

The cmd command tracer syntax is:
tracert [-d] [-h maximum_hops] [-j node_list] [-w interval] [target_resource_name]
Example implementation:
tracert -d -h 10 microsoft.com

The example traces the route to a specified resource. This increases the speed of the operation due to the use of the d parameter, which prevents the command from attempting to obtain permission to read IP addresses. The number of transitions (jumps) is limited to 10 using set value parameter h. By default, the number of jumps is 30:


shutdown [(-l|-s|-r|-a)] [-f] [-m [\PC_name]] [-t xx] [-c “messages”] [-d[u][p]: xx:yy]
Example:
shutdown /s /t 60 /f /l /m \191.162.1.53

The remote PC (m) with the specified IP address (191.162.1.53) will shut down (s) after 60 seconds (t). This will force you to log out of all applications (f) and the current user's session (l).

MEM Team

Displays the amount of used and free memory. Used to display information about allocated memory areas, free areas and programs loaded into memory.

MEM

To display the status of used and free memory, issue the MEM command without parameters.

The /CLASSIFY option lists the programs loaded into memory and shows how much regular and high memory is being used. MEM /CLASSIFY also calculates the total amount of memory used and displays the largest free blocks. /CLASSIFY can be shortened to /C.

/DEBUG Displays a list of programs and internal drivers loaded into memory. Shows the size of each module, segment address and module type, calculates the total amount of memory used and displays other information useful for programming. /DEBUG (abbreviated /D) can be used in combination with /PAGE, but not with other MEM options.

The /FREE option (abbreviated /F) displays a list of free areas of normal and high memory. MEM /FREE shows the segment address and size of each free area of ​​normal memory, as well as the largest free block in each area of ​​high memory. Summarizes the memory used.

/MODULE module_name shows how the program module uses memory (the name is required). Displays a list of memory areas allocated to this program and their sizes. /MODULE can be shortened to /M.

The /C, /F, and /M options can be used in combination with /PAGE, but not with each other.

The /PAGE option pauses after each screen is output. To automatically add the /PAGE option to the MEM command, you can use the DOSKEY program. To do this, include the following commands in AUTOEXEC.BAT:

C:\dos\doskey doskey mem=mem.exe $* /p

Checking disk memory is described in the CHKDSK command.

MS-DOS displays information about additional memory only when it is installed in the system. Extended memory status is only shown if extended memory is available that is compliant with LIM EMS version 4.0. MS-DOS displays the status of high memory only when installing a program for working with UMB blocks (type EMM386) and turning it on in CONFIG.SYS DOS commands=UMB. At running Windows Version 3.0 does not display the status of the high memory.

In the information output by the MEM command, "Adapter RAM/ROM" represents the memory in the connected cards (such as a video adapter). "Largest executable program size" is the largest contiguous block of ordinary memory available to a program, "Largest free upper memory block" is the largest area of ​​upper memory available to a program. "MS-DOS is resident in the high memory area" indicates that MS-DOS is running in the first 64K of additional memory, rather than in regular memory.

Some software modules, such as WIN386, allocate multiple memory areas. The MEM /MODULE command displays all areas allocated for a particular program, with their sizes and segment addresses. For high memory blocks, MEM /MODULE also shows the area number. The Type column shows how the program uses specific area memory. The "total size," column displays the total amount of memory allocated by MS-DOS for the program.

Displays the amount of used and free memory. Used to display information about allocated memory areas, free areas and programs loaded into memory.

MEM

To display the status of used and free memory, issue the MEM command without parameters.

The /CLASSIFY option lists the programs loaded into memory and shows how much regular and high memory is being used. MEM /CLASSIFY also calculates the total amount of memory used and displays the largest free blocks. /CLASSIFY can be shortened to /C.

/DEBUG Displays a list of programs and internal drivers loaded into memory. Shows the size of each module, segment address and module type, calculates the total amount of memory used and displays other information useful for programming. /DEBUG (abbreviated /D) can be used in combination with /PAGE, but not with other MEM options.

The /FREE option (abbreviated /F) displays a list of free areas of normal and high memory. MEM /FREE shows the segment address and size of each free area of ​​normal memory, as well as the largest free block in each area of ​​high memory. Summarizes the memory used.

/MODULE module_name shows how the program module uses memory (the name is required). Displays a list of memory areas allocated to this program and their sizes. /MODULE can be shortened to /M.

The /C, /F, and /M options can be used in combination with /PAGE, but not with each other.

The /PAGE option pauses after each screen is output. To automatically add the /PAGE option to the MEM command, you can use the DOSKEY program. To do this, include the following commands in AUTOEXEC.BAT:

C:\dos\doskey
doskey mem=mem.exe $* /p

Checking disk memory is described in the CHKDSK command.

MS-DOS displays information about additional memory only when it is installed in the system. Extended memory status is only shown if extended memory is available that is compliant with LIM EMS version 4.0. MS-DOS displays the status of the high memory only when installing a program for working with UMB blocks (type EMM386) and including the DOS=UMB command in CONFIG.SYS. By doing Windows versions 3.0 the state of the high memory is not displayed.

In the information output by the MEM command, “Adapter RAM/ROM” represents the memory in the connected cards (such as a video adapter). “Largest executable program size” is the largest contiguous block of ordinary memory available to a program, “Largest free upper memory block” is the largest area of ​​upper memory available to a program. "MS-DOS is resident in the high memory area" indicates that MS-DOS is running in the first 64K of additional memory, rather than in regular memory.

Some software modules, such as WIN386, allocate multiple memory areas. The MEM /MODULE command displays all areas allocated for a particular program, with their sizes and segment addresses. For high memory blocks, MEM /MODULE also shows the area number. The Type column shows how the program uses a specific area of ​​memory. The “total size,” column displays the total amount of memory allocated by MS-DOS for the program.

MEMMAKER Team

Runs the MemMaker program, which optimizes the computer's memory by moving device drivers and resident programs to higher memory. You can use MemMaker on machines with an 80386 or 80486 processor and additional memory. Do not use this command while Windows is running.

MEMMAKER

The /B option displays MemMaker in black and white. Use it if MemMaker does not work correctly on a monochrome monitor.

/BATCH launches MemMaker in automatic mode. At the same time, MemMaker itself responds to all prompts by default. In case of errors, MemMaker restores the previous contents of the CONFIG.SYS, AUTOEXEC.BAT and (if required) SYSTEM.INI Windows files. After MemMaker has finished running, you can view the status messages in the MEMMAKER.STS file.

The /SESSION parameter is used exclusively by MemMaker during the optimization process.

/SWAP:drive specifies the label letter and the drive that was boot disk. Enter a letter after the colon current disk. This parameter is only necessary if the drive letter has changed since the computer started. Otherwise MemMaker will not be able to find system files. When using Stacker 2.0, SuperStor or Microsoft DoubleSpace this parameter no need to indicate.

The /T parameter disables recognition of IBM Token-Ring networks. Specify this option if your computer includes such a network and you are having problems working with MemMaker.

/UNDO tells MemMaker that last changes needs to be cancelled. When MemMaker optimizes system memory, it modifies the CONFIG.SYS and AUTOEXEC.BAT files (and, if necessary, also Windows file SYSTEM.INI). If, after running MemMaker, your system does not work as expected, or you are not satisfied with the new memory configuration, you can use the /UNDO option to revert to the previous memory configuration by running MemMaker.

/W:n,m shows how much high memory should be reserved for buffers Windows broadcasts. Windows requires two areas of high memory for this purpose. The first of them is given by size n, the second by m. By default, MemMaker does not reserve high memory for Windows (equivalent to /W:0,0).

Loading device drivers into high memory is described in the description of the DEVICEHIGH command, and loading programs is described in the description of LOADHIGH.

MENUCOLOR Team

Sets the background and text color for the launch menu. Only used in the menu block in the CONFIG.SYS file.

The startup menu is a list of choices that appear when you start your computer. This menu is defined by special CONFIG.SYS commands. Each menu item corresponds to a set of CONFIG.SYS commands, called a configuration block. The startup menu allows you to select one of several configurations after starting your computer.

MENUCOLOR=x[,y]

The x parameter specifies the color of the menu text. The y parameter specifies the background color (black by default). x and y values ​​are allowed from 0 to 15, but they must be different.

The color meanings are given in the following table:

For example, the command menucolor=15, 2 specifies White color text on a green background. On some displays, colors 8 through 15 appear flickering.

MENUCOLOR is one of 6 special teams CONFIG.SYS, designed to define a startup menu with multiple configurations. See also INCLUDE, MENUITEM, MENUDEFAULT, NUMLOCK, SUBMENU commands.

MENUDEFAULT Command

Sets the default startup menu item and sets a timeout value if necessary. Only used in the menu block in the CONFIG.SYS file. If this command is not given, MS-DOS selects element 1 by default.

MENUDEFAULT=block_name[,timeout]

MENUDEFAULT is one of 6 special CONFIG.SYS commands designed to define a startup menu with multiple configurations. See also INCLUDE, MENUITEM, MENUCOLOR, NUMLOCK, SUBMENU commands.

The block_name parameter specifies the default menu item and associated configuration block that must be defined in CONFIG.SYS. When MS-DOS displays the startup menu, the default menu item is highlighted and its number is displayed after the "Enter a choice" prompt. "Timeout" determines how many seconds MS-DOS should wait before starting the computer with the default configuration. If this value is not set, MS-DOS simply waits for the key to be pressed. ENTER keys. You can set the timeout value from 0 to 90 seconds. 0 automatically selects the default configuration.

After starting MS-DOS displays a menu the following type(see example in the description of the INCLUDE command):

MS-DOS 6 Startup Menu
=====================
1. Basic configuration
2. Normal configuration
3. Special configuration
Enter a choice: 2 Time remaining: 30

After this menu is displayed, MS-DOS waits 30 seconds. If no other option is selected, MS-DOS starts the computer using the commands in the default configuration block.

MENUITEM command

Defines a startup menu item. Only used in the menu block in the CONFIG.SYS file. The menu can contain up to 9 selection items.

MENUITEM is one of 6 special CONFIG.SYS commands designed to define a startup menu with multiple configurations. See also commands: INCLUDE, MENUDEFAULT, MENUCOLOR, NUMLOCK, SUBMENU.

MENUITEM=block_name[,menu_text]

The block_name parameter specifies the name of the corresponding configuration block, which must be defined somewhere in the CONFIG.SYS file. If a menu item is selected at startup, MS-DOS executes the commands in the corresponding configuration block, as well as the commands at the beginning of CONFIG.SYS and all commands in configuration blocks with the heading .

If MS-DOS cannot find a block with given name, then the menu item is not displayed. The block name can be up to 70 characters long and contains most printable characters except spaces, backslashes, forwardslashes, commas, semicolons, equal signs, or square brackets. The "menu_text" parameter specifies the text that MS-DOS should display for a given menu item. If no text is specified, MS-DOS displays the block name as a menu item. Menu text can be up to 70 characters long and contain any symbols.

A menu block is a set of menu definition commands that begin with a block title (the name of the block in square brackets). To obtain a menu, the CONFIG.SYS file must contain a menu block with a block title. You can use the SUBMENU command to define a submenu. Each submenu has its own block, which can be named whatever you want. A menu block must contain at least one MENUITEM or SUBMENU command.

MS-DOS displays menu items in the order in which they are included in the menu block and numbers them automatically. The first menu item (element) is always numbered 1. The menu can contain up to 9 items in total. For determining more items, you can use the SUBMENU command.

The following block defines a launch menu with two elements - Main and Secondary:


menuitem=Main
menuitem=Secondary

When MS-DOS starts, a menu like this will be displayed:

MS-DOS 6 Startup Menu
=====================
1. Main
2.Secondary
Enter a choice: 1

See also the example in the INCLUDE command.

TEAM INDICATORS /MEM /GC /LAG

If the Essentials plugin is installed on the server, then after entering the /mem /gc or /lag commands we will see the readings in the chat:

1. Uptime is the time the server has been running since it was turned on.
2. TPS - Tick Per Second (qty. per second on the server).
3. Maximum memory - the amount of memory allocated to the server. Specified in the server startup parameter -Xmx.
4. Memory allocated - the amount of used memory that the server currently requires.
5. Free memory- the amount of memory freed by the garbage collector (java).





Let's take a closer look at the fourth point: “Memory allocated.”
Many people do not understand and think that they have been tricked with their memory. It is considered that the "memory allocated" value should be equal to the "Maximum memory" value. This is an extremely incorrect opinion and many people have it inexperienced users and Minecraft server administrators, for the reason incorrect translation plugin.

So! For server maximum memory 10,000 megabytes (you can allocate for the server more memory), but this does not mean that the server will immediately use it all. The server does not use more memory than it needs, so out of 10,000 megabytes it will take as much as it needs to work to begin with.
For example, when starting the server, 484 megabytes were required (as in the picture), but as the number of players on the server increases, the map for each player will be loaded, for this the server will require more memory, this is where the server will automatically begin to allocate more memory for its work from the maximum available to him, which is indicated in the first paragraph.

Other factors may also influence the increase in this indicator: a large number of plugins, incorrect operation of plugins, incorrect configuration plugins, reckless game process, constant huge sets (//set), flights with high speed/speed 5 - 10 and much more.

It can be explained more simply by comparing it with a bucket, water, the boy Vasya and his guests.
Let's imagine:
You have an empty bucket with a volume of 10 liters.
You have 1 liter of water.
The boy "Vasya" asked to bring him 1 liter of water.
You need to carry 1 liter of water in this bucket for the boy “Vasya”.
But suddenly “Vasya” reports that guests have come to him, 3 more boys, and he needs even more water, not 1 liter, but 4.
You successfully put all of this water into a 4 liter bucket.
After some time, Vasily reports that there are many more guests, there are no longer three, but seven of them, and 10 liters of water are already required + 1 liter for the boy Vasya, this is already 11 liters, and you only have a bucket for 10 liters of water, you are trying fit the eleventh liter into a 10 liter bucket, but water flows over the edge. As a result, you bring only 10 liters for 11 people, and each boy gets less than 1 liter.

The same thing happens with the server.
Minecraft developers recommend allocating 100 megabytes for each player random access memory, taking into account that the server will not be overloaded with plugins.
If the memory of your server is 10,000 megabytes, and the memory required for one player is 100 megabytes, then divide 10000:100=100 and we get one hundred, which means that with this amount of RAM, 100 people will comfortably play on the server, if the RAM is not consumed by your plugins and gameplay .

The bucket in this case will be the server itself, the capacity of which is allocated for it available memory 10,000 (as in the picture, this is an example), the water will be the memory spent for the operation of the server map and plugins, and the guests will be players entering the server for which a memory of at least 100 megabytes will be required.

The bottom line is that the “Memory allocated” indicator displays the amount of memory that is used by the server in this moment and is required for it to work. The amount of memory that plugins, map and players are currently consuming.

Of course, you can make the launch parameters such that the card will immediately be loaded to the limit of the memory allocated for the server, the indicators: “Maximum memory” and “Memory allocated” will be equal. This will bring sad results and constant crashes, since all the memory will be senselessly spent on a card that is not used by anyone.

The Minecraft server is designed in such a way that regions and chunks begin to load only when the player lands on them. For example, a player entered the server, teleported to a certain place on the server, and everything around this player in this place was loaded. Mobs began to run around, mechanisms began to work, the weather in this place began to change for the player, that is, everything came to life. All this requires about 100 megabytes of memory. The remaining areas of the map in those places where there are no players are disabled and RAM is not wasted on them.

Now let’s imagine that we have configured the server launch parameters so that our server loads the entire 10,000 megabyte map. The result will be the following - the territory of the map, which is not used by players, will consume all the RAM, and if the player falls outside the coordinates of the loaded map, then for this player there will be no more RAM for further loading of the map for them, lags will begin, or the server will crashes with the error " Out of Memory "The bucket is already full.)))