IN rural Stirlingshire where I grew up, the local "bad boys' homes" were the subject of perennial rumour, gossip and threat: if we didn't behave, we might be sent away to one of these institutions. Ballikinrain was one such establishment - known at the time as a "list D school" - and my mother worked there. The pervading sense was that these were bad places; that behind those walls, unknown and potentially terrible things happened. They were "bogeyman" institutions, and one question intrigued me: what on Earth could any child have done that was bad enough to end up in such a building, away from their friends and family?

Across Scotland, there are currently some 1000 children between the ages of eight and 16 living in residential schools. Most commonly, they are there because of "emotional and behavioural needs", and their number continues to rise. At a cost of around £2500 per week per boy to the local authorities that place them there, they are neither a quick nor an inexpensive solution.

My mother worked for 11 years at Ballikinrain, situated about four miles from our house at Balfron. The once-privately-owned 19th-century baronial castle subsequently served as a hotel and then a girls' school, before being taken over by the Church of Scotland as a residential school for boys in 1967. My mother was a "housemother" or carer, and used to recount how she would drive the boys back home for the weekend. Usually, they were excited by the prospect of seeing their families for the first time in a while. Occasionally, she would arrive with the boys and knock on the door only to hear that the parents had changed their minds about the home visit.

Sometimes she would bring the boys to our house, which gave me the chance to meet some of them. Although wary at first (some would steal anything they could get their hands on), I soon realised that, although they came from difficult backgrounds, these were ordinary kids who weren't all that different from me.

Although I occasionally visited the school as a child, I was never allowed into the sleeping quarters, but I know from my mother that they were spartan: two dormitories, each with 30 boys.

In recent years, more than £3 million has been spent on modernising Ballikinrain - every boy has his own room and there are fantastic amenities. From the outside, however, it remains a fairly forbidding looking place. Surrounded by hills, with massive trees on the grounds, it looks like Hogwarts School of Harry Potter fame.

Over the years, I have realised that my childhood ignorance and misconceptions regarding boys in such care were, and remain, the norm. Even people living with a residential school in their midst, it seems, typically don't know what goes on in them. Occasionally, they might hear reports that a boy has run away. Sometimes, allegations of mistreatment or poor management surface. What is rarely discussed is the exceptional commitment of the staff who try to provide a kind of surrogate family for children who have been removed from their families. Few have considered the dynamics of that bond: a bond which will inevitably be broken when the children go home to their own families. Perhaps the subject has just been too emotive for our Scottish sensibilities.

I determined to learn about, and share the reality of, life at Ballikinrain with a wider audience, by producing a series of documentaries with Saltire Films. Planning and making the film has been a long process. Our aim, simply put, was to live with, over a substantial period of time, some of the pupils at Ballikinrain.

We also involved their guardians and families where possible, as well as social workers, teachers and school staff. By telling their individual stories, The Boys Of Ballikinrain would explore the issues, difficulties and realities for children in residential care.

Boys at the school are placed there by local authorities, and we had to undertake continual consultation with social work departments around Scotland. The school's headteacher, Chris McNaught, says that the staff "had to think long and hard before letting the cameras in", but believes that "it is important that the public is made more aware of the work of residential schools - there are a lot of myths out there but not much in the way of true understanding".

We also had to ask ourselves many moral questions. For instance, how much detail of these children's stories could actually be shown? What was the possibility of any negative backlash for the boys and their families when the films were eventually transmitted? If, for example, we discovered during the shoot that a child had been sexually abused, should we show that in the finished film? The answer to this last question would be no.

Over the eight months of filming, we focused on half-a-dozen boys whose trust had been gained by director Stephen Bennett. They were incredibly candid and open. Camera workshops were organised to help the boys gain confidence and learn the practicalities of basic film-making. In addition, cameras were installed in the boys' rooms so that diaries could be recorded, day or night. Filming started as soon as the pupils woke up and often continued throughout that day and subsequent nights.

Our arrangements had to be extremely flexible. One major difficulty was in the commitment of those boys who agreed to appear on camera. Children can naturally be capricious, changing their minds in a matter of hours, let alone months, and sometimes, the appeal of "being a celebrity" wore off fairly rapidly. As a result, the boys actually appearing in the film, as well as their families and attendant carers, were subject to constant chopping and changing.

It is hard, until you attempt it, to appreciate the complexities of working with boys and their families who come from such difficult backgrounds. Families vary from the fractured to the chaotic, and the boys have often missed large chunks of their education.

But many of the stories are moving. One boy - who also has a relative at Ballikinrain - has not taken his hood down since arriving at the school. He wears it everywhere, when he goes to bed, and even when he goes swimming. In one of the programmes, a staff member speculates that this must act as a kind of security blanket. His relative, who is like a tiny angel, always wears a woolly hat. The programme doesn't go into detail about what those children have been through, but insights like this provide viewers with a clue to the difficulties some of them might have have experienced.

There are other manifestations of the damage that's been done to boys placed at the school. Mostly, it comes out in anger and aggression, often in the form of bad language and the trashing of rooms. Such pent-up rage, in an eight or 10-year-old, is pretty alarming.

But there's another side. We left video cameras in the individual bedrooms and taught the boys how to use them. Occasionally, in the middle of the night, they'd wake up after having a nightmare and say they wanted their mums. Indeed, on the phone, or in conversation, almost all of them constantly referred to missing their mothers and wanting to go home.

I hope what we have achieved in these films is to provide a glimpse into another side of these boys' personalities. They may be difficult and aggressive, but at heart, they are just lonely, vulnerable kids, who find themselves here as a result of a range of circumstances. But for the grace of God, it could be your child or mine.

I hope that the programmes will help promote understanding about the children who are cared for within schools such as Ballikinrain. There are youngsters in institutions like this all over Scotland; the numbers are going up, and that is a reflection on us as a society.

The timing of last week's Unicef report into the experience of children in the developed world could not have been more apposite. The report uncovers social attitudes and argues that compared with other Western nations, children are poorly looked after here in Britain. At the extreme end are children who come from very difficult backgrounds, who have to be taken away from their families for their own protection, and who end up in schools such as Ballikinrain.

The programmes also aim to highlight the extraordinary work done by staff at such schools in dealing with these tough and damaged boys. Their job is to try to help these youngsters reclaim their childhood and find a more positive future before lawlessness and despair became ingrained.

If these children are not given help, if they can't be shown some kind of light for the future, my sense is that they are going to face a recurring cycle of crime and aggression, the next stop being Polmont Young Offenders Institution and so forth.

In the past, filming in institutions such as Shotts Prison and Carstairs Hospital, I have been struck by the depressing waste of human potential, and our powerlessness to do anything to change that situation.

The residents of Ballikinrain are still children; there is a flicker of innocence, of hope. With assistance, perhaps these kids' lives can be saved. And helping these children will also save us, the taxpayers, as well as the police and everyone else, from having to deal with them for the next 30, 40, or 50 years.

These are not out-and-out villains; or the "bad boys" whispered about during my childhood and perhaps yours. When I was young, there were always guys who were mean, who were tough, and had some kind of bad streak in them, but neither then, nor now, had I met a single child who I thought was fundamentally bad.

Of course, as a society Britain is terribly generous. If you think of the money we donate every year to Children In Need that seems obvious. And yet, with a residential school likely to be somewhere just up the road from us, we sometimes don't see what's going on right under our noses.

These children's lives, says Chris McNaught, "have often been very chaotic, and we try to give them a sense of order. Equally importantly, we try to give them a route back into childhood so that they can get those building blocks which are important for the development of all individuals".

If Saltire Films' programmes can help people like McNaught to achieve some of their aspirations, they will have been worth making, and watching.

The Boys Of Ballikinrain starts on BBC Two Scotland, tomorrow at 9pm