Subedar-major
Subedar-major is the senior-most rank of junior commissioned officer in the Indian and Pakistani Armies, formerly known as the Viceroy's commissioned officer in the British Indian Army. History
During the British Raj, subedar-major was the highest rank natives could achieve. On 28 October 1817, the position was introduced by the East India Company (EIC) in the Native infantry of the Bengal Army, one of the three EIC's Presidency armies. The Madras Army adopted this rank on 2 February 1819. In 1825, the Bengal native cavalry established the equivalent rank of risaldar-major, which was soon adopted by the Presidency armies of Bombay and Madras. Both ranks would serve as a representative of their people to British officers, but could also command independent companies resp. troops of irregular regiments. Under British rule, in the British Indian Army a subedar-major wore the crown of a full major, a tradition which has continued with slight variation after independence. Subedar-major or risaldar-major equated to a British major and subedar or risaldar to captain, although junior to all British officers. Post independence

After independence, which came in 1947 with the Partition of India, the former British Indian Army was divided between India and Pakistan. Indian Army

In the Indian Army, subedar major (SM) is junior to a lieutenant who is a commissioned officer. They possess a high amount of experience and are referred to as SM Sahab. An SM can lead a single unit or a headquarters that has troops under its command. Many times, they have been given honorary ranks such as Hon. Lieutenant and Hon. Captain, as a mark of respect for their exceptional service record. The subedar majors and other Junior Commissioned Officers of the Indian Army are equivalent to Group-B gazetted officers in India. The subedar major ranks now use Ashoka lions with a Gold National Emblem with a red-gold-red stripe below. These stripes separate subedar-majors from full commissioned majors. Subedar major within the Indian Army is considered as the chief advisor of the commanding officer, responsible for advising him in critical service matters. Any incident which is affecting the unit administration, security, or morale of troops is reported by him, to the Commanding Officer. He is responsible for the security of troops, civilians, soldiers of other corps and services, posted in the unit, and troops who have come on outstation assignment to his unit. He also ensures the maintenance of unit & regiment traditions, ethos and customs, the upkeep, and the maintenance of religious places within the battalion. The subedar major is also the unit or regiment cashier who handles all cash transactions. He is also responsible for the welfare of all his junior JCOs as well as NCOs and ORs. A unit's subedar major also acts as a mentor to young commissioned officers as well as soldiers and is responsible for maintaining the collective discipline of the unit. Pakistan Army
Similar to other Commonwealth countries, Pakistan Army inherited its rank structure from the British Empire. Sergeant major is now the highest JCO/OR rank in the Pakistan Army, its equivalent to NATO OR-9 rank, with a wreathed star and crescent with green and red. These stripes separate subedar-majors from full commissioned majors. It is also known by other names such as subedar major or risaldar major. Battalion subedar-major (BSM), on the other hand, is an appointment within a regiment. A battalion subedar-major is responsible for advising the unit officers on matters pertaining to enlisted ranks. He is also responsible for maintaining enlisted ranks discipline. After the creation of Pakistan in 1947, the rank still holds significance in Pakistan Army culture, as the sergeant major in a battalion is regarded as an advocate for the enlisted ranks. Officers usually refer to senior enlisted ranks like battalion sergeant major as 'Sahab', which translates to Sir or 'Staff', as terms of respect. Military colleges like College of Electrical and Mechanical Engineering, Military College of Signals, Military College of Engineers, Pakistan Military Academy and Army Medical College also use battalion sergeant major as a cadet appointment reserved for senior year students. References

Military ranks of British India
Pakistan Army ranks
Military ranks of the Indian Army